dynamo

package
v0.0.0-...-2e21a08 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemHasKeyAttribute  string = "pk"
	ItemSortKeyAttribute string = "sk"
	ItemGsi1KeyAttribute string = "gsi1_pk"
	ItemGsi1IndexName    string = "GSI1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientWrapper

type ClientWrapper struct {
	// contains filtered or unexported fields
}

func NewClientWrapper

func NewClientWrapper(region string) *ClientWrapper

func NewClientWrapperFromClient

func NewClientWrapperFromClient(client *dynamodb.Client) *ClientWrapper

func (*ClientWrapper) GetItem

func (client *ClientWrapper) GetItem(input *dynamodb.GetItemInput) (*dynamodb.GetItemOutput, error)

func (*ClientWrapper) PutItem

func (client *ClientWrapper) PutItem(input *dynamodb.PutItemInput) (*dynamodb.PutItemOutput, error)

func (*ClientWrapper) QueryItem

func (client *ClientWrapper) QueryItem(input *dynamodb.QueryInput) (*dynamodb.QueryOutput, error)

type DbClient

type DbClient interface {
	PutItem(input *dynamodb.PutItemInput) (*dynamodb.PutItemOutput, error)
	GetItem(input *dynamodb.PutItemInput) (*dynamodb.PutItemOutput, error)
	QueryItem(input *dynamodb.QueryInput) (*dynamodb.QueryOutput, error)
}

type EventRepository

type EventRepository struct {
	// contains filtered or unexported fields
}

func NewEventRepository

func NewEventRepository(region string, tableName string, logger *zap.Logger) *EventRepository

func NewLocalEventRepository

func NewLocalEventRepository(dynamoClient *dynamodb.Client, tableName string, logger *zap.Logger) *EventRepository

func (*EventRepository) GetBookingEventsByBID

func (repo *EventRepository) GetBookingEventsByBID(bookingId string) (*[]booking.Event, error)

func (*EventRepository) GetByKey

func (repo *EventRepository) GetByKey(bookingId string, eventId string) (*booking.Event, error)

func (*EventRepository) Insert

func (repo *EventRepository) Insert(event *booking.Event) (*booking.Event, error)

type Item

type Item struct {
	Pk          string        `json:"pk" dynamodbav:"pk"`
	Sk          string        `json:"sk" dynamodbav:"sk"`
	Gsi1Pk      string        `json:"gsi1_pk" dynamodbav:"gsi1_pk"`
	EventId     string        `json:"event_id" dynamodbav:"event_id"`
	BookingId   string        `json:"booking_id" dynamodbav:"booking_id"`
	UserId      string        `json:"user_id" dynamodbav:"user_id"`
	TripFrom    string        `json:"from" dynamodbav:"from"`
	TripUntil   string        `json:"until" dynamodbav:"until"`
	HotelName   string        `json:"hotel_name" dynamodbav:"hotel_name"`
	HotelId     string        `json:"hotel_id" dynamodbav:"hotel_id"`
	FlightId    string        `json:"flight_id" dynamodbav:"flight_id"`
	AirlineName string        `json:"airline_name" dynamodbav:"airline_name"`
	State       booking.State `json:"state" dynamodbav:"state"`
}

Jump to

Keyboard shortcuts

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