options

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientOptions

func GetClientOptions(config *StakingClientConfig) ([]option.ClientOption, error)

GetClientOptions returns the list of ClientOptions based on the given endpoint, service name, and config.

func GetHTTPClient

func GetHTTPClient(serviceName string, config *StakingClientConfig) (*http.Client, error)

GetHTTPClient returns the HTTPClient based on the given service name and config.

func LROOptions

func LROOptions(op LongRunningOperation, version string, opts []gax.CallOption) []gax.CallOption

LROOptions returns the call options for long-running operations. This overrides the gapic generated client `WithPath` call option that ignores the path prefix, with a call option that includes the path prefix.

Types

type LongRunningOperation

type LongRunningOperation interface {
	Name() string
	PathPrefix() string
}

LongRunningOperation is the interface for long-running operations that is used to create the gax call options for interacting with LROs.

type StakingClientConfig

type StakingClientConfig struct {
	Endpoint      string
	ServiceName   string
	APIKey        *auth.APIKey
	HTTPClient    *http.Client
	ClientOptions []option.ClientOption
	Insecure      bool
}

StakingClientConfig stores configuration information about a Staking client.

func GetConfig

func GetConfig(
	serviceName string,
	defaultEndpoint string,
	stakingOpts ...StakingClientOption,
) (*StakingClientConfig, error)

GetConfig returns a StakingClientConfig with all the StakingClientOptions applied. It uses the given default endpoint if none of the options set it.

type StakingClientOption

type StakingClientOption func(c *StakingClientConfig)

StakingClientOption is a function that applies changes to a clientConfig.

func WithAPIKey

func WithAPIKey(apiKey *auth.APIKey) StakingClientOption

WithAPIKey returns an option to set the Coinbase Cloud API Key.

func WithClientOptions

func WithClientOptions(clientOptions ...option.ClientOption) StakingClientOption

WithClientOptions returns an option to set the inner set of ClientOptions.

func WithEndpoint

func WithEndpoint(endpoint string) StakingClientOption

WithEndpoint returns an option to set the service endpoint.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) StakingClientOption

WithHTTPClient returns an option to set the HTTP Client.

func WithInsecure

func WithInsecure(insecure bool) StakingClientOption

WithInsecure returns an option to set the insecure flag. If insecure is set to true, the client will not use transport authentication.

Jump to

Keyboard shortcuts

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