Documentation ¶
Overview ¶
Package client for storage plugin client
Index ¶
- type BuildOptions
- type Interface
- type StoragePluginClient
- func (p *StoragePluginClient) APIVersion() *schema.GroupVersion
- func (p *StoragePluginClient) Clone() *StoragePluginClient
- func (p *StoragePluginClient) Delete(ctx context.Context, path string, options ...client.OptionFunc) error
- func (p *StoragePluginClient) ForGroupVersion(gv *schema.GroupVersion) Interface
- func (p *StoragePluginClient) FullUrl(uri string) string
- func (p *StoragePluginClient) Get(ctx context.Context, path string, options ...client.OptionFunc) error
- func (p *StoragePluginClient) GetResponse(ctx context.Context, path string, options ...client.OptionFunc) (*resty.Response, error)
- func (p *StoragePluginClient) HandleError(response *resty.Response, err error) error
- func (p *StoragePluginClient) Post(ctx context.Context, path string, options ...client.OptionFunc) error
- func (p *StoragePluginClient) Put(ctx context.Context, path string, options ...client.OptionFunc) error
- func (p *StoragePluginClient) R(ctx context.Context, options ...client.OptionFunc) *resty.Request
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 ¶
func (p *StoragePluginClient) Clone() *StoragePluginClient
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 |