Version: v1.8.6 Latest Latest

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

Go to latest
Published: Jul 26, 2019 License: MIT Imports: 7 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type InMem

type InMem struct {
	// contains filtered or unexported fields

InMem is a in-memory store

func New

func New() *InMem

New creates a new mock

func (*InMem) Available

func (m *InMem) Available(ctx context.Context) error

Available will check if this backend is useable

func (*InMem) Delete

func (m *InMem) Delete(ctx context.Context, name string) error

Delete removes a value

func (*InMem) Exists

func (m *InMem) Exists(ctx context.Context, name string) bool

Exists checks is a value exists

func (*InMem) Fsck

func (m *InMem) Fsck(ctx context.Context) error

Fsck always returns nil

func (*InMem) Get

func (m *InMem) Get(ctx context.Context, name string) ([]byte, error)

Get retrieves a value

func (*InMem) IsDir

func (m *InMem) IsDir(ctx context.Context, name string) bool

IsDir returns true if the entry is a directory

func (*InMem) List

func (m *InMem) List(ctx context.Context, prefix string) ([]string, error)

List shows all values

func (*InMem) Name

func (m *InMem) Name() string

Name returns the name of this backend

func (*InMem) Prune

func (m *InMem) Prune(ctx context.Context, prefix string) error

Prune removes a directory

func (*InMem) Set

func (m *InMem) Set(ctx context.Context, name string, value []byte) error

Set writes a value

func (*InMem) String added in v1.7.2

func (m *InMem) String() string

String implement fmt.Stringer

func (*InMem) Version

func (m *InMem) Version(context.Context) semver.Version

Version returns the version of this backend

Source Files

Jump to

Keyboard shortcuts

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