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 {
	UserID     string
	OrderID    string
	Amount     int64
	CommitedAt time.Time
}

func (*Order) ToInsertMap

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

type OrderDetail

type OrderDetail struct {
	UserID        string
	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

type User

type User struct {
	UserID    string
	UserName  string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*User) ToInsertMap

func (u *User) ToInsertMap() map[string]interface{}

type UsersStore

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

func NewUsersStore

func NewUsersStore(sc *spanner.Client) (*UsersStore, error)

func (*UsersStore) Insert

func (s *UsersStore) Insert(ctx context.Context, user *User) (time.Time, error)

func (*UsersStore) TableName

func (s *UsersStore) TableName() string

Jump to

Keyboard shortcuts

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