crdstorage

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

README

CircleCI

crdstorage

Package crdstorage implements the microstorage interface to provide storage primitives based on Kubernetes CRDs. The microstorage implementation using Kubernetes third-party-objects as its backend.

projects using crdstorage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Config

type Config struct {
	G8sClient versioned.Interface
	K8sClient kubernetes.Interface
	Logger    micrologger.Logger

	Name      string
	Namespace *corev1.Namespace
}

type Storage

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

func New

func New(config Config) (*Storage, error)

New creates an uninitialized instance of Storage. It is required to call Boot before running any read/write operations against the returned Storage instance.

func (*Storage) Boot

func (s *Storage) Boot(ctx context.Context) error

Boot initializes the Storage by ensuring Kubernetes resources used by the Storage are in place. It is safe to call Boot more than once.

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, k microstorage.K) error

func (*Storage) Exists

func (s *Storage) Exists(ctx context.Context, k microstorage.K) (bool, error)

func (*Storage) List

func (s *Storage) List(ctx context.Context, k microstorage.K) ([]microstorage.KV, error)

func (*Storage) Put

func (s *Storage) Put(ctx context.Context, kv microstorage.KV) error

func (*Storage) Search

func (s *Storage) Search(ctx context.Context, k microstorage.K) (microstorage.KV, error)

Jump to

Keyboard shortcuts

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