Documentation ¶
Index ¶
- type GormClient
- func (gc *GormClient) Check() bool
- func (gc *GormClient) Close()
- func (gc *GormClient) GetRandomAccount(ctx context.Context) (model.AccountData, error)
- func (gc *GormClient) QueryAccount(ctx context.Context, accountId string) (model.AccountData, error)
- func (gc *GormClient) QueryAccountByNameWithCount(ctx context.Context, name string) ([]Pair, error)
- func (gc *GormClient) SeedAccounts() error
- func (gc *GormClient) SetupDB(addr string)
- func (gc *GormClient) StoreAccount(ctx context.Context, accountData model.AccountData) (model.AccountData, error)
- func (gc *GormClient) UpdateAccount(ctx context.Context, accountData model.AccountData) (model.AccountData, error)
- type IGormClient
- type Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormClient ¶
type GormClient struct {
// contains filtered or unexported fields
}
func NewGormClient ¶
func NewGormClient(cfg *cmd.Config) *GormClient
func (*GormClient) Check ¶
func (gc *GormClient) Check() bool
func (*GormClient) Close ¶
func (gc *GormClient) Close()
func (*GormClient) GetRandomAccount ¶
func (gc *GormClient) GetRandomAccount(ctx context.Context) (model.AccountData, error)
func (*GormClient) QueryAccount ¶
func (gc *GormClient) QueryAccount(ctx context.Context, accountId string) (model.AccountData, error)
func (*GormClient) QueryAccountByNameWithCount ¶
func (*GormClient) SeedAccounts ¶
func (gc *GormClient) SeedAccounts() error
func (*GormClient) SetupDB ¶
func (gc *GormClient) SetupDB(addr string)
func (*GormClient) StoreAccount ¶
func (gc *GormClient) StoreAccount(ctx context.Context, accountData model.AccountData) (model.AccountData, error)
StoreAccount uses ACID TX.
func (*GormClient) UpdateAccount ¶
func (gc *GormClient) UpdateAccount(ctx context.Context, accountData model.AccountData) (model.AccountData, error)
UpdateAccount uses ACID TX.
type IGormClient ¶
type IGormClient interface { UpdateAccount(ctx context.Context, accountData model.AccountData) (model.AccountData, error) StoreAccount(ctx context.Context, accountData model.AccountData) (model.AccountData, error) QueryAccount(ctx context.Context, accountId string) (model.AccountData, error) GetRandomAccount(ctx context.Context) (model.AccountData, error) QueryAccountByNameWithCount(ctx context.Context, name string) ([]Pair, error) SetupDB(addr string) SeedAccounts() error Check() bool Close() }
IGormClient defines a number of operations we want to be able to perform vs an underlying data store.
Directories ¶
Path | Synopsis |
---|---|
Package mock_dbclient is a generated GoMock package.
|
Package mock_dbclient is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.