Documentation ¶
Index ¶
- type Repo
- func (r *Repo) CreateBet(ctx context.Context, bet *api.Bet) error
- func (r *Repo) CreateMarket(ctx context.Context, market *api.Market) error
- func (r *Repo) CreateUser(ctx context.Context, user *api.User) error
- func (r *Repo) GetBet(ctx context.Context, id string) (*api.Bet, error)
- func (r *Repo) GetMarket(ctx context.Context, id string) (*api.Market, error)
- func (r *Repo) GetUser(ctx context.Context, id string) (*api.User, error)
- func (r *Repo) GetUserByUsername(ctx context.Context, book, username string) (*api.User, error)
- func (r *Repo) ListBets(ctx context.Context, args *repo.ListBetsArgs) ([]*api.Bet, bool, error)
- func (r *Repo) ListMarkets(ctx context.Context, args *repo.ListMarketsArgs) ([]*api.Market, bool, error)
- func (r *Repo) ListUsers(ctx context.Context, args *repo.ListUsersArgs) ([]*api.User, bool, error)
- func (r *Repo) UpdateBet(ctx context.Context, bet *api.Bet) error
- func (r *Repo) UpdateMarket(ctx context.Context, market *api.Market) error
- func (r *Repo) UpdateUser(ctx context.Context, user *api.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
Repo is an file-backed gob 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) ListMarkets ¶
func (r *Repo) ListMarkets(ctx context.Context, args *repo.ListMarketsArgs) ([]*api.Market, bool, error)
ListMarkets lists markets.
func (*Repo) UpdateMarket ¶
UpdateMarket updates a market.
Click to show internal directories.
Click to hide internal directories.