Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CreditsCurrency is the currency used to charge Fabriktor credits. CreditsCurrency = money.USD )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.1.1122
type Client interface {
contract.CreditLedgerOperator
}
func NewClient ¶ added in v0.1.1122
func NewClient(d Dependencies, opts ClientOptions) (Client, error)
type ClientOption ¶
type ClientOption = contract.Opt[ClientOptions]
func WithAuthenticationSecret ¶ added in v0.1.1122
func WithAuthenticationSecret(x []byte) ClientOption
func WithConsumeCreditsURL ¶
func WithConsumeCreditsURL(x *url.URL) ClientOption
func WithLoaded ¶
func WithLoaded(x Loaded) ClientOption
func WithTotalCreditsURL ¶ added in v0.1.1122
func WithTotalCreditsURL(x *url.URL) ClientOption
type ClientOptions ¶
type ClientOptions struct {
Loaded
}
func ApplyClientOptions ¶
func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions
type DefaultTool ¶ added in v0.1.1122
func NewTool ¶ added in v0.1.1122
func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool
func (*DefaultTool) ConsumeCredits ¶ added in v0.1.1122
func (d *DefaultTool) ConsumeCredits(ctx context.Context, opts contract.ConsumeCreditsOptions) (*contract.RPConsumeCredits, error)
ConsumeCredits consumes credits for a backend-defined operation.
func (*DefaultTool) TotalCredits ¶ added in v0.1.1122
func (d *DefaultTool) TotalCredits(ctx context.Context, opts contract.TotalCreditsOptions) (*contract.RPTotalCredits, error)
TotalCredits returns the current credit balance for an owner.
type Dependencies ¶ added in v0.1.1122
type Dependencies struct {
HD contract.HTTPDoer
HR contract.HTTPRequester
U contract.Unmarshaler
M contract.Marshaler
E contract.EnvironmentOperator
}
Click to show internal directories.
Click to hide internal directories.