Documentation ¶
Index ¶
- Constants
- func NewBettorServiceHandler(svc BettorServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
- type BettorServiceClient
- type BettorServiceHandler
- type UnimplementedBettorServiceHandler
- func (UnimplementedBettorServiceHandler) CancelMarket(context.Context, *connect_go.Request[v1alpha.CancelMarketRequest]) (*connect_go.Response[v1alpha.CancelMarketResponse], error)
- func (UnimplementedBettorServiceHandler) CreateBet(context.Context, *connect_go.Request[v1alpha.CreateBetRequest]) (*connect_go.Response[v1alpha.CreateBetResponse], error)
- func (UnimplementedBettorServiceHandler) CreateMarket(context.Context, *connect_go.Request[v1alpha.CreateMarketRequest]) (*connect_go.Response[v1alpha.CreateMarketResponse], error)
- func (UnimplementedBettorServiceHandler) CreateUser(context.Context, *connect_go.Request[v1alpha.CreateUserRequest]) (*connect_go.Response[v1alpha.CreateUserResponse], error)
- func (UnimplementedBettorServiceHandler) GetBet(context.Context, *connect_go.Request[v1alpha.GetBetRequest]) (*connect_go.Response[v1alpha.GetBetResponse], error)
- func (UnimplementedBettorServiceHandler) GetMarket(context.Context, *connect_go.Request[v1alpha.GetMarketRequest]) (*connect_go.Response[v1alpha.GetMarketResponse], error)
- func (UnimplementedBettorServiceHandler) GetUser(context.Context, *connect_go.Request[v1alpha.GetUserRequest]) (*connect_go.Response[v1alpha.GetUserResponse], error)
- func (UnimplementedBettorServiceHandler) GetUserByUsername(context.Context, *connect_go.Request[v1alpha.GetUserByUsernameRequest]) (*connect_go.Response[v1alpha.GetUserByUsernameResponse], error)
- func (UnimplementedBettorServiceHandler) ListBets(context.Context, *connect_go.Request[v1alpha.ListBetsRequest]) (*connect_go.Response[v1alpha.ListBetsResponse], error)
- func (UnimplementedBettorServiceHandler) ListMarkets(context.Context, *connect_go.Request[v1alpha.ListMarketsRequest]) (*connect_go.Response[v1alpha.ListMarketsResponse], error)
- func (UnimplementedBettorServiceHandler) ListUsers(context.Context, *connect_go.Request[v1alpha.ListUsersRequest]) (*connect_go.Response[v1alpha.ListUsersResponse], error)
- func (UnimplementedBettorServiceHandler) LockMarket(context.Context, *connect_go.Request[v1alpha.LockMarketRequest]) (*connect_go.Response[v1alpha.LockMarketResponse], error)
- func (UnimplementedBettorServiceHandler) SettleMarket(context.Context, *connect_go.Request[v1alpha.SettleMarketRequest]) (*connect_go.Response[v1alpha.SettleMarketResponse], error)
Constants ¶
const ( // BettorServiceCreateUserProcedure is the fully-qualified name of the BettorService's CreateUser // RPC. BettorServiceCreateUserProcedure = "/bettor.v1alpha.BettorService/CreateUser" // BettorServiceGetUserProcedure is the fully-qualified name of the BettorService's GetUser RPC. BettorServiceGetUserProcedure = "/bettor.v1alpha.BettorService/GetUser" // BettorServiceGetUserByUsernameProcedure is the fully-qualified name of the BettorService's // GetUserByUsername RPC. BettorServiceGetUserByUsernameProcedure = "/bettor.v1alpha.BettorService/GetUserByUsername" // BettorServiceListUsersProcedure is the fully-qualified name of the BettorService's ListUsers RPC. BettorServiceListUsersProcedure = "/bettor.v1alpha.BettorService/ListUsers" // BettorServiceCreateMarketProcedure is the fully-qualified name of the BettorService's // CreateMarket RPC. BettorServiceCreateMarketProcedure = "/bettor.v1alpha.BettorService/CreateMarket" // BettorServiceGetMarketProcedure is the fully-qualified name of the BettorService's GetMarket RPC. BettorServiceGetMarketProcedure = "/bettor.v1alpha.BettorService/GetMarket" // BettorServiceListMarketsProcedure is the fully-qualified name of the BettorService's ListMarkets // RPC. BettorServiceListMarketsProcedure = "/bettor.v1alpha.BettorService/ListMarkets" // BettorServiceLockMarketProcedure is the fully-qualified name of the BettorService's LockMarket // RPC. BettorServiceLockMarketProcedure = "/bettor.v1alpha.BettorService/LockMarket" // BettorServiceSettleMarketProcedure is the fully-qualified name of the BettorService's // SettleMarket RPC. BettorServiceSettleMarketProcedure = "/bettor.v1alpha.BettorService/SettleMarket" // BettorServiceCancelMarketProcedure is the fully-qualified name of the BettorService's // CancelMarket RPC. BettorServiceCancelMarketProcedure = "/bettor.v1alpha.BettorService/CancelMarket" // BettorServiceCreateBetProcedure is the fully-qualified name of the BettorService's CreateBet RPC. BettorServiceCreateBetProcedure = "/bettor.v1alpha.BettorService/CreateBet" // BettorServiceGetBetProcedure is the fully-qualified name of the BettorService's GetBet RPC. BettorServiceGetBetProcedure = "/bettor.v1alpha.BettorService/GetBet" // BettorServiceListBetsProcedure is the fully-qualified name of the BettorService's ListBets RPC. BettorServiceListBetsProcedure = "/bettor.v1alpha.BettorService/ListBets" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// BettorServiceName is the fully-qualified name of the BettorService service.
BettorServiceName = "bettor.v1alpha.BettorService"
)
Variables ¶
This section is empty.
Functions ¶
func NewBettorServiceHandler ¶
func NewBettorServiceHandler(svc BettorServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
NewBettorServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type BettorServiceClient ¶
type BettorServiceClient interface { // CreateUser creates a new user. CreateUser(context.Context, *connect_go.Request[v1alpha.CreateUserRequest]) (*connect_go.Response[v1alpha.CreateUserResponse], error) // GetUser returns a user by name. GetUser(context.Context, *connect_go.Request[v1alpha.GetUserRequest]) (*connect_go.Response[v1alpha.GetUserResponse], error) // GetUserByUsername returns a user by name. GetUserByUsername(context.Context, *connect_go.Request[v1alpha.GetUserByUsernameRequest]) (*connect_go.Response[v1alpha.GetUserByUsernameResponse], error) // ListUsers lists users by filters. ListUsers(context.Context, *connect_go.Request[v1alpha.ListUsersRequest]) (*connect_go.Response[v1alpha.ListUsersResponse], error) // CreateMarket creates a new betting market. CreateMarket(context.Context, *connect_go.Request[v1alpha.CreateMarketRequest]) (*connect_go.Response[v1alpha.CreateMarketResponse], error) // GetMarket gets a betting market by name. GetMarket(context.Context, *connect_go.Request[v1alpha.GetMarketRequest]) (*connect_go.Response[v1alpha.GetMarketResponse], error) // ListMarkets lists markets by filters. ListMarkets(context.Context, *connect_go.Request[v1alpha.ListMarketsRequest]) (*connect_go.Response[v1alpha.ListMarketsResponse], error) // LockMarket locks a betting market preventing further bets. LockMarket(context.Context, *connect_go.Request[v1alpha.LockMarketRequest]) (*connect_go.Response[v1alpha.LockMarketResponse], error) // SettleMarket settles a betting market and pays out bets. SettleMarket(context.Context, *connect_go.Request[v1alpha.SettleMarketRequest]) (*connect_go.Response[v1alpha.SettleMarketResponse], error) // CancelMarket cancels a betting market and redunds all bettors. CancelMarket(context.Context, *connect_go.Request[v1alpha.CancelMarketRequest]) (*connect_go.Response[v1alpha.CancelMarketResponse], error) // CreateBet places a bet on an open betting market. CreateBet(context.Context, *connect_go.Request[v1alpha.CreateBetRequest]) (*connect_go.Response[v1alpha.CreateBetResponse], error) // GetBet gets a bet. GetBet(context.Context, *connect_go.Request[v1alpha.GetBetRequest]) (*connect_go.Response[v1alpha.GetBetResponse], error) // ListBet lists bets by filters. ListBets(context.Context, *connect_go.Request[v1alpha.ListBetsRequest]) (*connect_go.Response[v1alpha.ListBetsResponse], error) }
BettorServiceClient is a client for the bettor.v1alpha.BettorService service.
func NewBettorServiceClient ¶
func NewBettorServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) BettorServiceClient
NewBettorServiceClient constructs a client for the bettor.v1alpha.BettorService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type BettorServiceHandler ¶
type BettorServiceHandler interface { // CreateUser creates a new user. CreateUser(context.Context, *connect_go.Request[v1alpha.CreateUserRequest]) (*connect_go.Response[v1alpha.CreateUserResponse], error) // GetUser returns a user by name. GetUser(context.Context, *connect_go.Request[v1alpha.GetUserRequest]) (*connect_go.Response[v1alpha.GetUserResponse], error) // GetUserByUsername returns a user by name. GetUserByUsername(context.Context, *connect_go.Request[v1alpha.GetUserByUsernameRequest]) (*connect_go.Response[v1alpha.GetUserByUsernameResponse], error) // ListUsers lists users by filters. ListUsers(context.Context, *connect_go.Request[v1alpha.ListUsersRequest]) (*connect_go.Response[v1alpha.ListUsersResponse], error) // CreateMarket creates a new betting market. CreateMarket(context.Context, *connect_go.Request[v1alpha.CreateMarketRequest]) (*connect_go.Response[v1alpha.CreateMarketResponse], error) // GetMarket gets a betting market by name. GetMarket(context.Context, *connect_go.Request[v1alpha.GetMarketRequest]) (*connect_go.Response[v1alpha.GetMarketResponse], error) // ListMarkets lists markets by filters. ListMarkets(context.Context, *connect_go.Request[v1alpha.ListMarketsRequest]) (*connect_go.Response[v1alpha.ListMarketsResponse], error) // LockMarket locks a betting market preventing further bets. LockMarket(context.Context, *connect_go.Request[v1alpha.LockMarketRequest]) (*connect_go.Response[v1alpha.LockMarketResponse], error) // SettleMarket settles a betting market and pays out bets. SettleMarket(context.Context, *connect_go.Request[v1alpha.SettleMarketRequest]) (*connect_go.Response[v1alpha.SettleMarketResponse], error) // CancelMarket cancels a betting market and redunds all bettors. CancelMarket(context.Context, *connect_go.Request[v1alpha.CancelMarketRequest]) (*connect_go.Response[v1alpha.CancelMarketResponse], error) // CreateBet places a bet on an open betting market. CreateBet(context.Context, *connect_go.Request[v1alpha.CreateBetRequest]) (*connect_go.Response[v1alpha.CreateBetResponse], error) // GetBet gets a bet. GetBet(context.Context, *connect_go.Request[v1alpha.GetBetRequest]) (*connect_go.Response[v1alpha.GetBetResponse], error) // ListBet lists bets by filters. ListBets(context.Context, *connect_go.Request[v1alpha.ListBetsRequest]) (*connect_go.Response[v1alpha.ListBetsResponse], error) }
BettorServiceHandler is an implementation of the bettor.v1alpha.BettorService service.
type UnimplementedBettorServiceHandler ¶
type UnimplementedBettorServiceHandler struct{}
UnimplementedBettorServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedBettorServiceHandler) CancelMarket ¶
func (UnimplementedBettorServiceHandler) CancelMarket(context.Context, *connect_go.Request[v1alpha.CancelMarketRequest]) (*connect_go.Response[v1alpha.CancelMarketResponse], error)
func (UnimplementedBettorServiceHandler) CreateBet ¶
func (UnimplementedBettorServiceHandler) CreateBet(context.Context, *connect_go.Request[v1alpha.CreateBetRequest]) (*connect_go.Response[v1alpha.CreateBetResponse], error)
func (UnimplementedBettorServiceHandler) CreateMarket ¶
func (UnimplementedBettorServiceHandler) CreateMarket(context.Context, *connect_go.Request[v1alpha.CreateMarketRequest]) (*connect_go.Response[v1alpha.CreateMarketResponse], error)
func (UnimplementedBettorServiceHandler) CreateUser ¶
func (UnimplementedBettorServiceHandler) CreateUser(context.Context, *connect_go.Request[v1alpha.CreateUserRequest]) (*connect_go.Response[v1alpha.CreateUserResponse], error)
func (UnimplementedBettorServiceHandler) GetBet ¶
func (UnimplementedBettorServiceHandler) GetBet(context.Context, *connect_go.Request[v1alpha.GetBetRequest]) (*connect_go.Response[v1alpha.GetBetResponse], error)
func (UnimplementedBettorServiceHandler) GetMarket ¶
func (UnimplementedBettorServiceHandler) GetMarket(context.Context, *connect_go.Request[v1alpha.GetMarketRequest]) (*connect_go.Response[v1alpha.GetMarketResponse], error)
func (UnimplementedBettorServiceHandler) GetUser ¶
func (UnimplementedBettorServiceHandler) GetUser(context.Context, *connect_go.Request[v1alpha.GetUserRequest]) (*connect_go.Response[v1alpha.GetUserResponse], error)
func (UnimplementedBettorServiceHandler) GetUserByUsername ¶
func (UnimplementedBettorServiceHandler) GetUserByUsername(context.Context, *connect_go.Request[v1alpha.GetUserByUsernameRequest]) (*connect_go.Response[v1alpha.GetUserByUsernameResponse], error)
func (UnimplementedBettorServiceHandler) ListBets ¶
func (UnimplementedBettorServiceHandler) ListBets(context.Context, *connect_go.Request[v1alpha.ListBetsRequest]) (*connect_go.Response[v1alpha.ListBetsResponse], error)
func (UnimplementedBettorServiceHandler) ListMarkets ¶
func (UnimplementedBettorServiceHandler) ListMarkets(context.Context, *connect_go.Request[v1alpha.ListMarketsRequest]) (*connect_go.Response[v1alpha.ListMarketsResponse], error)
func (UnimplementedBettorServiceHandler) ListUsers ¶
func (UnimplementedBettorServiceHandler) ListUsers(context.Context, *connect_go.Request[v1alpha.ListUsersRequest]) (*connect_go.Response[v1alpha.ListUsersResponse], error)
func (UnimplementedBettorServiceHandler) LockMarket ¶
func (UnimplementedBettorServiceHandler) LockMarket(context.Context, *connect_go.Request[v1alpha.LockMarketRequest]) (*connect_go.Response[v1alpha.LockMarketResponse], error)
func (UnimplementedBettorServiceHandler) SettleMarket ¶
func (UnimplementedBettorServiceHandler) SettleMarket(context.Context, *connect_go.Request[v1alpha.SettleMarketRequest]) (*connect_go.Response[v1alpha.SettleMarketResponse], error)