db

package
v0.0.0-...-8fd779a Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	RODB
	CreateOrUpdate(api.Object)
	Delete(string)
}

type RODB

type RODB interface {
	List() []api.Object
	Get(string) (api.Object, bool)
}

type Store

type Store interface {
	Read() ([]byte, error)
	Write([]byte) error
	Close() error
}

Store provides a simple read/write abstraction for persistence.

func NewSecretStore

func NewSecretStore(cli kubernetes.Interface, namespace, namePrefix string) Store

NewSecretStore returns a Store that persists data in Kubernetes Secrets. Data is gzip-compressed and chunked into secrets named <namePrefix>-0, <namePrefix>-1, etc. in the given namespace.

type StupidDB

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

StupidDB is a stupid persistence store for protobufs that support `GetMetadata().GetId()`. It must not be used in production. It is intended to be thrown away.

func NewStupidDB

func NewStupidDB(filename string) *StupidDB

func NewStupidDBWithSecret

func NewStupidDBWithSecret(cli kubernetes.Interface, namespace, namePrefix string) *StupidDB

NewStupidDBWithSecret creates a StupidDB backed by Kubernetes Secrets. Data is gzip-compressed and chunked into secrets named <namePrefix>-0, <namePrefix>-1, etc. in the given namespace.

func (*StupidDB) Close

func (db *StupidDB) Close()

func (*StupidDB) CreateOrUpdate

func (db *StupidDB) CreateOrUpdate(obj api.Object)

func (*StupidDB) Delete

func (db *StupidDB) Delete(id string)

func (*StupidDB) Get

func (db *StupidDB) Get(id string) (api.Object, bool)

func (*StupidDB) List

func (db *StupidDB) List() []api.Object

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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