client

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Overview

Package client for storage plugin client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildOptions

type BuildOptions func(client *StoragePluginClient)

BuildOptions Options to build the plugin client

func WithClassAddress

func WithClassAddress(address *v1.Addressable) BuildOptions

WithClassAddress sets client based address url for plugin client

func WithGroupVersion

func WithGroupVersion(gv *schema.GroupVersion) BuildOptions

WithGroupVersion adds a custom client build options for plugin client

func WithRestClient

func WithRestClient(clt *resty.Client) BuildOptions

WithRestClient adds a custom client build options for plugin client

type Interface

type Interface interface {
	Get(ctx context.Context, path string,
		options ...client.OptionFunc) error
	GetResponse(ctx context.Context, path string,
		options ...client.OptionFunc) (*resty.Response, error)
	Put(ctx context.Context, path string,
		options ...client.OptionFunc) error
	Post(ctx context.Context, path string,
		options ...client.OptionFunc) error
	Delete(ctx context.Context, path string,
		options ...client.OptionFunc) error
	APIVersion() *schema.GroupVersion

	ForGroupVersion(gv *schema.GroupVersion) Interface
}

Interface captures the set of operations for generically interacting with Kubernetes REST apis.

type StoragePluginClient

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

StoragePluginClient is the client for storage client.

func NewStoragePluginClient

func NewStoragePluginClient(baseURL *duckv1.Addressable, opts ...BuildOptions) *StoragePluginClient

NewStoragePluginClient creates a new plugin client

func (*StoragePluginClient) APIVersion

func (p *StoragePluginClient) APIVersion() *schema.GroupVersion

func (*StoragePluginClient) Clone

Clone shallow clone the plugin client used to update some fields without changing the original

func (*StoragePluginClient) Delete

func (p *StoragePluginClient) Delete(ctx context.Context, path string,
	options ...client.OptionFunc) error

Delete performs a DELETE request with the given parameters

func (*StoragePluginClient) ForGroupVersion

func (p *StoragePluginClient) ForGroupVersion(gv *schema.GroupVersion) Interface

func (*StoragePluginClient) FullUrl

func (p *StoragePluginClient) FullUrl(uri string) string

FullUrl returns actual url

func (*StoragePluginClient) Get

func (p *StoragePluginClient) Get(ctx context.Context, path string,
	options ...client.OptionFunc) error

Get performs a GET request using defined options

func (*StoragePluginClient) GetResponse

func (p *StoragePluginClient) GetResponse(ctx context.Context, path string,
	options ...client.OptionFunc) (*resty.Response, error)

GetResponse performs a GET request using defined options and return raw resty.Response

func (*StoragePluginClient) HandleError

func (p *StoragePluginClient) HandleError(response *resty.Response, err error) error

HandleError assigns error as http response

func (*StoragePluginClient) Post

func (p *StoragePluginClient) Post(ctx context.Context, path string,
	options ...client.OptionFunc) error

Post performs a POST request with the given parameters

func (*StoragePluginClient) Put

func (p *StoragePluginClient) Put(ctx context.Context, path string,
	options ...client.OptionFunc) error

Put performs a PUT request with the given parameters

func (*StoragePluginClient) R

func (p *StoragePluginClient) R(ctx context.Context, options ...client.OptionFunc) *resty.Request

R prepares a request based on the given information

Directories

Path Synopsis
versioned
archive/v1alpha1
Package v1alpha1 for archive v1alpha1 client
Package v1alpha1 for archive v1alpha1 client
core/v1alpha1
Package v1alpha1 for storage plugin core v1alpha1 client
Package v1alpha1 for storage plugin core v1alpha1 client
filestore/v1alpha1
Package v1alpha1 for file store v1alpha1 client
Package v1alpha1 for file store v1alpha1 client

Jump to

Keyboard shortcuts

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