mysql

package
v0.0.0-...-05ef5cd Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ErrCodeDupe = 1062

Variables

This section is empty.

Functions

func GetContext

func GetContext(ctx context.Context, q sqlx.QueryerContext, dest interface{}, query string, args ...interface{}) error

func SelectContext

func SelectContext(ctx context.Context, q sqlx.QueryerContext, dest interface{}, query string, args ...interface{}) error

Types

type AddressStore

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

func NewAddressStore

func NewAddressStore(db db.DB) *AddressStore

func (*AddressStore) CreateAddress

func (a *AddressStore) CreateAddress(ctx context.Context, addr *domain.Address) error

func (*AddressStore) WithTx

func (a *AddressStore) WithTx(db db.DB) domain.AddressStore

type CardStore

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

func NewCardStore

func NewCardStore(db db.DB) *CardStore

func (*CardStore) CreateCard

func (c *CardStore) CreateCard(ctx context.Context, card *domain.Card) error

func (*CardStore) WithTx

func (c *CardStore) WithTx(db db.DB) domain.CardStore

type SockStore

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

func NewSockStore

func NewSockStore(db db.DB) *SockStore

func (*SockStore) Count

func (s *SockStore) Count(ctx context.Context, tags []string) (int, error)

func (*SockStore) Create

func (s *SockStore) Create(ctx context.Context, sock domain.Sock) error

func (*SockStore) Get

func (s *SockStore) Get(ctx context.Context, id string) (domain.Sock, error)

func (*SockStore) List

func (s *SockStore) List(ctx context.Context, tags []string, order string, limit, offset int) ([]domain.Sock, error)

func (*SockStore) Tags

func (s *SockStore) Tags(ctx context.Context) ([]string, error)

func (*SockStore) Update

func (s *SockStore) Update(ctx context.Context, sock domain.Sock) error

type UserStore

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

func NewUserStore

func NewUserStore(db db.DB) *UserStore

func (*UserStore) CreateAddress

func (u *UserStore) CreateAddress(ctx context.Context, addrID string, userID string) error

func (*UserStore) CreateCard

func (u *UserStore) CreateCard(ctx context.Context, cardID string, userID string) error

func (*UserStore) CreateUser

func (u *UserStore) CreateUser(ctx context.Context, user *domain.User) error

func (*UserStore) Delete

func (u *UserStore) Delete(ctx context.Context, entity string, id string) error

func (*UserStore) GetAddress

func (u *UserStore) GetAddress(ctx context.Context, id string) (domain.Address, error)

func (*UserStore) GetCard

func (u *UserStore) GetCard(ctx context.Context, id string) (domain.Card, error)

func (*UserStore) GetUser

func (u *UserStore) GetUser(ctx context.Context, id string) (domain.User, error)

func (*UserStore) GetUserAddresses

func (u *UserStore) GetUserAddresses(ctx context.Context, userID string) ([]domain.Address, error)

func (*UserStore) GetUserByName

func (u *UserStore) GetUserByName(ctx context.Context, uname string) (domain.User, error)

func (*UserStore) GetUserCards

func (u *UserStore) GetUserCards(ctx context.Context, userID string) ([]domain.Card, error)

func (*UserStore) GetUsers

func (u *UserStore) GetUsers(ctx context.Context) ([]domain.User, error)

func (*UserStore) WithTx

func (u *UserStore) WithTx(db db.DB) domain.UserStore

Jump to

Keyboard shortcuts

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