Documentation
¶
Index ¶
- type Driver
- type KeyValue
- type KubernetesDriver
- func (d KubernetesDriver) Delete(ctx context.Context, key string) error
- func (d KubernetesDriver) Get(ctx context.Context, key string) ([]byte, error)
- func (d KubernetesDriver) List(_ context.Context, path string) ([]KeyValue, error)
- func (d KubernetesDriver) Put(ctx context.Context, key string, v []byte) error
- type KubernetesOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface {
// Get retrieves a data for the given key(i.e. /dir/key) from the Driver,
// returns an error if no such key.
Get(ctx context.Context, key string) ([]byte, error)
// Put stores the data in the Driver under the given key(i.e. /dir/key),
// returns error if the operation was not successful,
// otherwise, Get, must results in the original data.
Put(ctx context.Context, key string, value []byte) error
// Delete removes a data from the Driver under the given key(i.e. /dir/key),
// returns nil if no such key.
Delete(ctx context.Context, key string) error
// List lists all data under the path(i.e. /dir).
List(ctx context.Context, path string) ([]KeyValue, error)
}
type KubernetesDriver ¶
type KubernetesDriver struct {
// contains filtered or unexported fields
}
func NewKubernetes ¶
func NewKubernetes(ctx context.Context, opts KubernetesOptions) (*KubernetesDriver, error)
func (KubernetesDriver) Delete ¶
func (d KubernetesDriver) Delete(ctx context.Context, key string) error
type KubernetesOptions ¶
type KubernetesOptions struct {
// Namespace indicates the working namespace.
Namespace string
// Config indicates the kubernetes rest config.
Config *rest.Config
// Logger indicates the logger used by the driver,
// uses default logger if not set.
Logger log.Logger
// RaiseNotFound indicates the function to raise not found error,
// uses default function if not set.
RaiseNotFound func(key string) error
}
Click to show internal directories.
Click to hide internal directories.