bettorv1alphaconnect

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
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.

View Source
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.

Jump to

Keyboard shortcuts

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