query

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBooking

func CreateBooking(ctx context.Context, data interface{}) error

CreateBooking checks if the DynamoDB Table is configured on the environment, and creates a new booking record.

func CreateBusLine

func CreateBusLine(ctx context.Context, data interface{}) error

CreateBusLine checks if the DynamoDB Table is configured on the environment, and creates a new bus line record.

func CreateBusRoute

func CreateBusRoute(ctx context.Context, data interface{}) error

CreateBusRoute checks if the DynamoDB Table is configured on the environment, and creates a new bus route record.

func CreateBusUnit

func CreateBusUnit(ctx context.Context, data interface{}) error

CreateBusUnit checks if the DynamoDB Table is configured on the environment, and creates a new bus unit record.

func CreateUserAccount

func CreateUserAccount(ctx context.Context, data interface{}) error

CreateUserAccount checks if the DynamoDB Table is configured on the environment, and creates a new user account.

func FilterBookings

func FilterBookings(ctx context.Context, busId, routeId, status string) ([]schema.Bookings, error)

FilterBookings checks if the DynamoDB Table is configured on the environment, fetches and returns a list of bookings information.

func FilterBusLine

func FilterBusLine(ctx context.Context, name, company string) ([]schema.Bus, error)

FilterBusLine checks if the DynamoDB Table is configured on the environment, fetches and returns a list of bus line information.

func FilterBusRoute

func FilterBusRoute(ctx context.Context, route schema.BusRouteFilter) ([]schema.BusRoute, error)

FilterBusRoute checks if the DynamoDB Table is configured on the environment, fetches and returns a list of bus routes information.

func FilterBusUnit

func FilterBusUnit(ctx context.Context, code, busId string, active *bool) ([]schema.BusUnit, error)

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

func GetBookingRecords(ctx context.Context, id, busRouteId string) ([]schema.Bookings, error)

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

func GetBusLineRecords(ctx context.Context, id, name string) ([]schema.Bus, error)

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

func GetBusRouteRecords(ctx context.Context, id, busId string) ([]schema.BusRoute, error)

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

func GetBusUnitRecords(ctx context.Context, code, busId string) ([]schema.BusUnit, error)

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

func GetUserAccountById(ctx context.Context, id string) (schema.User, error)

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

func GetUserAccountRecords(ctx context.Context, id, username string) ([]schema.User, error)

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

func InsertItem(ctx context.Context, tablename string, data interface{}) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL