Documentation ¶
Index ¶
- func CreateBooking(ctx context.Context, data interface{}) error
- func CreateBusLine(ctx context.Context, data interface{}) error
- func CreateBusRoute(ctx context.Context, data interface{}) error
- func CreateBusUnit(ctx context.Context, data interface{}) error
- func CreateUserAccount(ctx context.Context, data interface{}) error
- func FilterBookings(ctx context.Context, busId, routeId, status string) ([]schema.Bookings, error)
- func FilterBusLine(ctx context.Context, name, company string) ([]schema.Bus, error)
- func FilterBusRoute(ctx context.Context, route schema.BusRouteFilter) ([]schema.BusRoute, error)
- func FilterBusUnit(ctx context.Context, code, busId string, active *bool) ([]schema.BusUnit, error)
- func FilterItems(ctx context.Context, tablename string, filter expression.ConditionBuilder) (*dynamodb.ScanOutput, error)
- func GetBookingRecords(ctx context.Context, id, busRouteId string) ([]schema.Bookings, error)
- func GetBusLineRecords(ctx context.Context, id, name string) ([]schema.Bus, error)
- func GetBusRouteRecords(ctx context.Context, id, busId string) ([]schema.BusRoute, error)
- func GetBusUnitRecords(ctx context.Context, code, busId string) ([]schema.BusUnit, error)
- func GetCancelledBookingRecords(ctx context.Context, bookingId string) ([]schema.BookingCancelled, error)
- func GetUserAccountById(ctx context.Context, id string) (schema.User, error)
- func GetUserAccountRecords(ctx context.Context, id, username string) ([]schema.User, error)
- func InsertItem(ctx context.Context, tablename string, data interface{}) error
- func IsExisting(ctx context.Context, tablename string, key expression.KeyConditionBuilder) (bool, error)
- func RecordBookingCancelled(ctx context.Context, key map[string]types.AttributeValue, ...) (schema.BookingCancelled, error)
- func UpdateBooking(ctx context.Context, key map[string]types.AttributeValue, ...) (schema.Bookings, error)
- func UpdateBusLine(ctx context.Context, key map[string]types.AttributeValue, ...) (schema.Bus, error)
- func UpdateBusRoute(ctx context.Context, key map[string]types.AttributeValue, ...) (schema.BusRoute, error)
- func UpdateBusUnit(ctx context.Context, key map[string]types.AttributeValue, ...) (schema.BusUnit, error)
- func UpdateItem(ctx context.Context, tablename string, key map[string]types.AttributeValue, ...) (*dynamodb.UpdateItemOutput, error)
- func UpdateUserAcccount(ctx context.Context, key map[string]types.AttributeValue, ...) (schema.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBooking ¶
CreateBooking checks if the DynamoDB Table is configured on the environment, and creates a new booking record.
func CreateBusLine ¶
CreateBusLine checks if the DynamoDB Table is configured on the environment, and creates a new bus line record.
func CreateBusRoute ¶
CreateBusRoute checks if the DynamoDB Table is configured on the environment, and creates a new bus route record.
func CreateBusUnit ¶
CreateBusUnit checks if the DynamoDB Table is configured on the environment, and creates a new bus unit record.
func CreateUserAccount ¶
CreateUserAccount checks if the DynamoDB Table is configured on the environment, and creates a new user account.
func FilterBookings ¶
FilterBookings checks if the DynamoDB Table is configured on the environment, fetches and returns a list of bookings information.
func FilterBusLine ¶
FilterBusLine checks if the DynamoDB Table is configured on the environment, fetches and returns a list of bus line information.
func FilterBusRoute ¶
FilterBusRoute checks if the DynamoDB Table is configured on the environment, fetches and returns a list of bus routes information.
func FilterBusUnit ¶
FilterBusUnit checks if the DynamoDB Table is configured on the environment, fetches and returns a list of bus unit information.
func FilterItems ¶
func FilterItems(ctx context.Context, tablename string, filter expression.ConditionBuilder) (*dynamodb.ScanOutput, error)
FilterItems creates an expression with ConditionBuilder, performs the DynamoDB Scan operation, and returns a list of attributes of the items.
func GetBookingRecords ¶
GetBookingRecords checks if the DynamoDB Table is configured on the environment, and returns either a specific booking record or a list of booking records.
func GetBusLineRecords ¶
GetBusLineRecords checks if the DynamoDB Table is configured on the environment, and returns either the specific bus line or a list of bus line records.
func GetBusRouteRecords ¶
GetBusRouteRecords checks if the DynamoDB Table is configured on the environment, and returns either the specific bus line route or a list of bus line route records.
func GetBusUnitRecords ¶
GetBusUnitRecords checks if the DynamoDB Table is configured on the environment, and returns either the specific bus line unit or a list of bus line unit records.
func GetCancelledBookingRecords ¶
func GetCancelledBookingRecords(ctx context.Context, bookingId string) ([]schema.BookingCancelled, error)
GetCancelledBookingRecords checks if the DynamoDB Table is configured on the environment, and returns either a specific cancelled booking or a list of cancelled bookings.
func GetUserAccountById ¶
GetUserAccountById checks if the DynamoDB Table is configured on the environment, and fetch the user account by id and returns the user account information.
func GetUserAccountRecords ¶
GetUserAccountRecords checks if the DynamoDB Table is configured on the environment, and returns either the specific user account or a list of user account records.
func InsertItem ¶
InsertItem converts the data into a map of AttributeValues and performs DynamoDB Put Item Operation to create the new item into the DynamoDB Table.
func IsExisting ¶
func IsExisting(ctx context.Context, tablename string, key expression.KeyConditionBuilder) (bool, error)
IsExisting creates an expression, performs DyanmoDB Query Operation, and returns if the item from the DynamoDB Table exist or not.
func RecordBookingCancelled ¶
func RecordBookingCancelled(ctx context.Context, key map[string]types.AttributeValue, update expression.UpdateBuilder) (schema.BookingCancelled, error)
RecordBookingCancelled updates the existing item's attribute or adds a new item to the table if it does not exist.
func UpdateBooking ¶
func UpdateBooking(ctx context.Context, key map[string]types.AttributeValue, update expression.UpdateBuilder) (schema.Bookings, error)
UpdateBooking checks if the DynamoDB Table is configured on the environment and updates the booking record.
func UpdateBusLine ¶
func UpdateBusLine(ctx context.Context, key map[string]types.AttributeValue, update expression.UpdateBuilder) (schema.Bus, error)
UpdateBusLine checks if the DynamoDB Table is configured on the environment and updates the bus line's information or record.
func UpdateBusRoute ¶
func UpdateBusRoute(ctx context.Context, key map[string]types.AttributeValue, update expression.UpdateBuilder) (schema.BusRoute, error)
UpdateBusRoute checks if the DynamoDB Table is configured on the environment and updates the bus routes information or record.
func UpdateBusUnit ¶
func UpdateBusUnit(ctx context.Context, key map[string]types.AttributeValue, update expression.UpdateBuilder) (schema.BusUnit, error)
UpdateBusUnit checks if the DynamoDB Table is configured on the environment and updates the bus unit's information or record.
func UpdateItem ¶
func UpdateItem(ctx context.Context, tablename string, key map[string]types.AttributeValue, update expression.UpdateBuilder) (*dynamodb.UpdateItemOutput, error)
UpdateItem creates an expression with UpdateBuilder, performs the DynamoDB UpdateItem operation, and returns all of the attributes of the item.
func UpdateUserAcccount ¶
func UpdateUserAcccount(ctx context.Context, key map[string]types.AttributeValue, update expression.UpdateBuilder) (schema.User, error)
UpdateUserAcccount checks if the DynamoDB Table is configured on the environment and updates the user account’s information or record.
Types ¶
This section is empty.