client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Types

type GCPClient

type GCPClient struct {
	// contains filtered or unexported fields
}

nolint:govet

func GetGCPClient

func GetGCPClient() (*GCPClient, error)

func (*GCPClient) Close

func (c *GCPClient) Close() []error

Close at the main client level is responsible for shutting down all the underlying service clients

func (*GCPClient) GetGcpFunctionClient

func (c *GCPClient) GetGcpFunctionClient(ctx context.Context) (*functionsv2.FunctionClient, error)

func (*GCPClient) GetStorageClient

func (c *GCPClient) GetStorageClient(ctx context.Context) (*storage.Client, error)

func (*GCPClient) HTTPClient

func (c *GCPClient) HTTPClient() HTTPClient

func (*GCPClient) ProjectID

func (c *GCPClient) ProjectID() string

func (*GCPClient) SetHTTPClient

func (c *GCPClient) SetHTTPClient(httpClient HTTPClient)

SetHTTPClient allows the user to set a custom HTTP client to be used by the GCP client this allows for better testing and control over the HTTP client

type GCPClientAPI

type GCPClientAPI interface {
	GetGcpFunctionClient(context.Context) (*functionsv2.FunctionClient, error)
	GetStorageClient(context.Context) (*storage.Client, error)
	ProjectID() string
	HTTPClient() HTTPClient
	SetHTTPClient(httpClient HTTPClient)
	Close() []error
}

type GcpFunctionAPI

type GcpFunctionAPI interface {
	GetFunction(ctx context.Context, req *functionspb.GetFunctionRequest, opts ...gax.CallOption) (*functionspb.Function, error)
	Close() error
}

type GcpGcsAPI

type GcpGcsAPI interface {
	Bucket(name string) *storage.BucketHandle
	Close() error
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

Jump to

Keyboard shortcuts

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