Documentation ¶
Index ¶
- type Repo
- func (r *Repo) CreateBet(_ context.Context, bet *api.Bet) error
- func (r *Repo) CreateMarket(_ context.Context, market *api.Market) error
- func (r *Repo) CreateUser(_ context.Context, user *api.User) error
- func (r *Repo) GetBet(_ context.Context, name string) (*api.Bet, error)
- func (r *Repo) GetMarket(_ context.Context, name string) (*api.Market, error)
- func (r *Repo) GetUser(ctx context.Context, name string) (*api.User, error)
- func (r *Repo) GetUserByUsername(ctx context.Context, book, username string) (*api.User, error)
- func (r *Repo) ListBets(_ context.Context, args *repo.ListBetsArgs) (bets []*api.Bet, hasMore bool, err error)
- func (r *Repo) ListMarkets(_ context.Context, args *repo.ListMarketsArgs) (markets []*api.Market, hasMore bool, err error)
- func (r *Repo) ListUsers(ctx context.Context, args *repo.ListUsersArgs) (users []*api.User, hasMore bool, err error)
- func (r *Repo) UpdateBet(_ context.Context, bet *api.Bet) error
- func (r *Repo) UpdateMarket(_ context.Context, market *api.Market) error
- func (r *Repo) UpdateUser(_ context.Context, user *api.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct { Users []*api.User Markets []*api.Market Bets []*api.Bet // contains filtered or unexported fields }
Repo is an in-memory persistence repository.
func (*Repo) CreateMarket ¶
CreateMarket creates a new market.
func (*Repo) CreateUser ¶
CreateUser creates a new user.
func (*Repo) GetUserByUsername ¶
GetUserByUsername gets a user by username.
func (*Repo) ListBets ¶
func (r *Repo) ListBets(_ context.Context, args *repo.ListBetsArgs) (bets []*api.Bet, hasMore bool, err error)
ListBets lists bets by filters.
func (*Repo) ListMarkets ¶
func (r *Repo) ListMarkets(_ context.Context, args *repo.ListMarketsArgs) (markets []*api.Market, hasMore bool, err error)
ListMarkets lists markets by filters.
func (*Repo) ListUsers ¶
func (r *Repo) ListUsers(ctx context.Context, args *repo.ListUsersArgs) (users []*api.User, hasMore bool, err error)
ListUsers lists users by filters.
func (*Repo) UpdateMarket ¶
UpdateMarket updates a market.
Click to show internal directories.
Click to hide internal directories.