crdstorage

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址