repo

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

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListBetsArgs

type ListBetsArgs struct {
	Book            string
	GreaterThanName string
	User            string
	Market          string
	ExcludeSettled  bool
	Limit           int
}

ListBetsArgs are the arguments for listing bets.

type ListMarketsArgs

type ListMarketsArgs struct {
	Book            string
	GreaterThanName string
	Status          api.Market_Status
	Limit           int
}

ListMarketsArgs are the arguments for listing markets.

type ListUsersArgs

type ListUsersArgs struct {
	Book            string
	GreaterThanName string
	Users           []string
	Limit           int
	// valid options: "name" asc (default), "total_centipoints" desc
	OrderBy string
}

ListUsersArgs are the arguments for listing users.

type Repo

type Repo interface {
	CreateUser(ctx context.Context, user *api.User) error
	UpdateUser(ctx context.Context, user *api.User) error
	GetUser(ctx context.Context, name string) (*api.User, error)
	GetUserByUsername(ctx context.Context, book, username string) (*api.User, error)
	ListUsers(ctx context.Context, args *ListUsersArgs) (users []*api.User, hasMore bool, err error)
	CreateMarket(ctx context.Context, market *api.Market) error
	UpdateMarket(ctx context.Context, market *api.Market) error
	GetMarket(ctx context.Context, name string) (*api.Market, error)
	ListMarkets(ctx context.Context, args *ListMarketsArgs) (markets []*api.Market, hasMore bool, err error)
	CreateBet(ctx context.Context, bet *api.Bet) error
	UpdateBet(ctx context.Context, bet *api.Bet) error
	GetBet(ctx context.Context, name string) (*api.Bet, error)
	ListBets(ctx context.Context, args *ListBetsArgs) (bets []*api.Bet, hasMore bool, err error)
}

Repo is a persistence repository.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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