stores

package
v0.0.0-...-21e8389 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ItemID    string
	ItemName  string
	Price     int64
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Order

type Order struct {
	OrderID    string
	UserID     string
	Amount     int64
	CommitedAt time.Time
}

func (*Order) ToInsertMap

func (o *Order) ToInsertMap() map[string]interface{}

type OrderDetail

type OrderDetail struct {
	OrderID       string
	OrderDetailID int64
	ItemID        string
	Price         int64
	Quantity      int64
	CommitedAt    time.Time
}

func (*OrderDetail) ToInsertMap

func (od *OrderDetail) ToInsertMap() map[string]interface{}

type OrdersStore

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

func NewOrdersStore

func NewOrdersStore(sc *spanner.Client) (*OrdersStore, error)

func (*OrdersStore) Insert

func (s *OrdersStore) Insert(ctx context.Context, userID string, orderID string, details []*OrderDetail) (commitTimestamp time.Time, err error)

func (*OrdersStore) OrderDetailsTableName

func (s *OrdersStore) OrderDetailsTableName() string

func (*OrdersStore) OrderTableName

func (s *OrdersStore) OrderTableName() string

Jump to

Keyboard shortcuts

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