persist

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore added in v0.0.6

type Datastore struct {
	// The Google Cloud project hosting the datastore
	ProjectID string

	// Cloud Datastore entity Kind
	Kind string
	// contains filtered or unexported fields
}

func (*Datastore) Close added in v0.0.6

func (d *Datastore) Close() error

Close always returns nil

func (*Datastore) Delete added in v0.0.6

func (d *Datastore) Delete(key string) error

Delete deletes a key from the domain map

func (*Datastore) Dump added in v0.0.6

func (d *Datastore) Dump() ([]byte, error)

Dump is not implemented

func (*Datastore) Get added in v0.0.6

func (d *Datastore) Get(key string) (string, error)

Get returns a value from the domain map

func (*Datastore) Init added in v0.0.6

func (d *Datastore) Init() error

Init configures the cloud datastore client

func (*Datastore) Set added in v0.0.6

func (d *Datastore) Set(r record.Record) error

Set adds a key value pair to the domain map

type Memory

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

Memory is a Memory type that satisfies the Persist interface

func (*Memory) Close

func (m *Memory) Close() error

Close always returns nil

func (*Memory) Delete

func (m *Memory) Delete(key string) error

Delete deletes a key from the domain map

func (*Memory) Dump added in v0.0.5

func (m *Memory) Dump() ([]byte, error)

Dump returns all entires json encoded

func (*Memory) Get

func (m *Memory) Get(key string) (string, error)

Get returns a value from the domain map

func (*Memory) Init

func (m *Memory) Init() error

Init creates the initial domain map

func (*Memory) Set

func (m *Memory) Set(r record.Record) error

Set adds a key value pair to the domain map

type Persist

type Persist interface {
	// Initialize the namespace
	Init() error

	// Get a key's value
	Get(key string) (string, error)

	// Set a key's value
	Set(r record.Record) error

	// Delete a key
	Delete(key string) error

	// Close the connection
	Close() error

	// Dump all entries
	Dump() ([]byte, error)
}

Jump to

Keyboard shortcuts

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