Documentation ¶
Index ¶
- Constants
- func NewBillingHandler(svc BillingHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
- type BillingClient
- type BillingHandler
- type UnimplementedBillingHandler
- func (UnimplementedBillingHandler) CreateBillingPlan(context.Context, *connect_go.Request[billing.CreateBillingPlanReq]) (*connect_go.Response[billing.CreateBillingPlanRes], error)
- func (UnimplementedBillingHandler) DeleteBillingDetails(context.Context, *connect_go.Request[billing.DeleteBillingDetailsReq]) (*connect_go.Response[billing.DeleteBillingDetailsRes], error)
- func (UnimplementedBillingHandler) GetBillingPlan(context.Context, *connect_go.Request[billing.GetBillingPlanReq]) (*connect_go.Response[billing.GetBillingPlanRes], error)
- func (UnimplementedBillingHandler) GetInvoice(context.Context, *connect_go.Request[billing.GetInvoiceReq]) (*connect_go.Response[billing.GetInvoiceRes], error)
- func (UnimplementedBillingHandler) UpdateBillingPlan(context.Context, *connect_go.Request[billing.UpdateBillingPlanReq]) (*connect_go.Response[billing.UpdateBillingPlanRes], error)
Constants ¶
const ( // BillingCreateBillingPlanProcedure is the fully-qualified name of the Billing's CreateBillingPlan // RPC. BillingCreateBillingPlanProcedure = "/api.v1alpha1.billing.Billing/CreateBillingPlan" // BillingGetBillingPlanProcedure is the fully-qualified name of the Billing's GetBillingPlan RPC. BillingGetBillingPlanProcedure = "/api.v1alpha1.billing.Billing/GetBillingPlan" // BillingUpdateBillingPlanProcedure is the fully-qualified name of the Billing's UpdateBillingPlan // RPC. BillingUpdateBillingPlanProcedure = "/api.v1alpha1.billing.Billing/UpdateBillingPlan" // BillingDeleteBillingDetailsProcedure is the fully-qualified name of the Billing's // DeleteBillingDetails RPC. BillingDeleteBillingDetailsProcedure = "/api.v1alpha1.billing.Billing/DeleteBillingDetails" // BillingGetInvoiceProcedure is the fully-qualified name of the Billing's GetInvoice RPC. BillingGetInvoiceProcedure = "/api.v1alpha1.billing.Billing/GetInvoice" )
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 (
// BillingName is the fully-qualified name of the Billing service.
BillingName = "api.v1alpha1.billing.Billing"
)
Variables ¶
This section is empty.
Functions ¶
func NewBillingHandler ¶
func NewBillingHandler(svc BillingHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
NewBillingHandler 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 BillingClient ¶
type BillingClient interface { // CreateBillingPlan - saves the provided billing plan, and returns the saved // plan. However, in an organization's Billing Plan there can only ever be // one billing detail with a specific config type and event type. CreateBillingPlan(context.Context, *connect_go.Request[billing.CreateBillingPlanReq]) (*connect_go.Response[billing.CreateBillingPlanRes], error) // GetBillingPlan - returns the billing plan for the provided organization. GetBillingPlan(context.Context, *connect_go.Request[billing.GetBillingPlanReq]) (*connect_go.Response[billing.GetBillingPlanRes], error) // UpdateBillingPlan - updates the provided billing plan and it's details. // If some details are not provided, they will be left as is. However, if // deletion is desired, the DeleteBillingDetails method should be used. The // billing plan still follows the constraint of only having one billing detail // with a specific config type and event type, and so if the request contains // more than one billing detail with a config type and event type, the request // is malformed and will result in potentially unexpected behavior. UpdateBillingPlan(context.Context, *connect_go.Request[billing.UpdateBillingPlanReq]) (*connect_go.Response[billing.UpdateBillingPlanRes], error) // DeleteBillingDetails - deletes the provided billing details. If the billing // details do not exist, this won't do anything. DeleteBillingDetails(context.Context, *connect_go.Request[billing.DeleteBillingDetailsReq]) (*connect_go.Response[billing.DeleteBillingDetailsRes], error) // GetInvoice - returns the invoice for the organization. If a date is // provided, this will return the invoice for the organization that // corresponds to the billing cycle that contains the provided date. If // no date is provided, this will return the invoice as it currently // stands for the current billing cycle. GetInvoice(context.Context, *connect_go.Request[billing.GetInvoiceReq]) (*connect_go.Response[billing.GetInvoiceRes], error) }
BillingClient is a client for the api.v1alpha1.billing.Billing service.
func NewBillingClient ¶
func NewBillingClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) BillingClient
NewBillingClient constructs a client for the api.v1alpha1.billing.Billing 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 BillingHandler ¶
type BillingHandler interface { // CreateBillingPlan - saves the provided billing plan, and returns the saved // plan. However, in an organization's Billing Plan there can only ever be // one billing detail with a specific config type and event type. CreateBillingPlan(context.Context, *connect_go.Request[billing.CreateBillingPlanReq]) (*connect_go.Response[billing.CreateBillingPlanRes], error) // GetBillingPlan - returns the billing plan for the provided organization. GetBillingPlan(context.Context, *connect_go.Request[billing.GetBillingPlanReq]) (*connect_go.Response[billing.GetBillingPlanRes], error) // UpdateBillingPlan - updates the provided billing plan and it's details. // If some details are not provided, they will be left as is. However, if // deletion is desired, the DeleteBillingDetails method should be used. The // billing plan still follows the constraint of only having one billing detail // with a specific config type and event type, and so if the request contains // more than one billing detail with a config type and event type, the request // is malformed and will result in potentially unexpected behavior. UpdateBillingPlan(context.Context, *connect_go.Request[billing.UpdateBillingPlanReq]) (*connect_go.Response[billing.UpdateBillingPlanRes], error) // DeleteBillingDetails - deletes the provided billing details. If the billing // details do not exist, this won't do anything. DeleteBillingDetails(context.Context, *connect_go.Request[billing.DeleteBillingDetailsReq]) (*connect_go.Response[billing.DeleteBillingDetailsRes], error) // GetInvoice - returns the invoice for the organization. If a date is // provided, this will return the invoice for the organization that // corresponds to the billing cycle that contains the provided date. If // no date is provided, this will return the invoice as it currently // stands for the current billing cycle. GetInvoice(context.Context, *connect_go.Request[billing.GetInvoiceReq]) (*connect_go.Response[billing.GetInvoiceRes], error) }
BillingHandler is an implementation of the api.v1alpha1.billing.Billing service.
type UnimplementedBillingHandler ¶
type UnimplementedBillingHandler struct{}
UnimplementedBillingHandler returns CodeUnimplemented from all methods.
func (UnimplementedBillingHandler) CreateBillingPlan ¶
func (UnimplementedBillingHandler) CreateBillingPlan(context.Context, *connect_go.Request[billing.CreateBillingPlanReq]) (*connect_go.Response[billing.CreateBillingPlanRes], error)
func (UnimplementedBillingHandler) DeleteBillingDetails ¶
func (UnimplementedBillingHandler) DeleteBillingDetails(context.Context, *connect_go.Request[billing.DeleteBillingDetailsReq]) (*connect_go.Response[billing.DeleteBillingDetailsRes], error)
func (UnimplementedBillingHandler) GetBillingPlan ¶
func (UnimplementedBillingHandler) GetBillingPlan(context.Context, *connect_go.Request[billing.GetBillingPlanReq]) (*connect_go.Response[billing.GetBillingPlanRes], error)
func (UnimplementedBillingHandler) GetInvoice ¶
func (UnimplementedBillingHandler) GetInvoice(context.Context, *connect_go.Request[billing.GetInvoiceReq]) (*connect_go.Response[billing.GetInvoiceRes], error)
func (UnimplementedBillingHandler) UpdateBillingPlan ¶
func (UnimplementedBillingHandler) UpdateBillingPlan(context.Context, *connect_go.Request[billing.UpdateBillingPlanReq]) (*connect_go.Response[billing.UpdateBillingPlanRes], error)