inmem

package
v1.15.13 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package inmem implements an in memory storage backend for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMem

type InMem struct {
	sync.Mutex
	// contains filtered or unexported fields
}

InMem is a thread-safe in-memory store.

func New

func New() *InMem

New creates a new mock.

func (*InMem) Add

func (m *InMem) Add(ctx context.Context, args ...string) error

Add does nothing.

func (*InMem) AddRemote

func (m *InMem) AddRemote(ctx context.Context, remote, url string) error

AddRemote does nothing.

func (*InMem) Cmd

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

Cmd does nothing.

func (*InMem) Commit

func (m *InMem) Commit(ctx context.Context, msg string) error

Commit does nothing.

func (*InMem) Compact

func (m *InMem) Compact(context.Context) error

Compact is not implemented.

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) GetRevision

func (m *InMem) GetRevision(context.Context, string, string) ([]byte, error)

GetRevision is not implemented.

func (*InMem) Init

func (m *InMem) Init(context.Context, string, string) error

Init does nothing.

func (*InMem) InitConfig

func (m *InMem) InitConfig(context.Context, string, string) error

InitConfig does nothing.

func (*InMem) IsDir

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

IsDir returns true if the entry is a directory.

func (m *InMem) Link(context.Context, string, string) error

Link is not implemented.

func (*InMem) List

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

List shows all values.

func (*InMem) Move added in v1.14.1

func (m *InMem) Move(context.Context, string, string, bool) error

Move is not implemented.

func (*InMem) Name

func (m *InMem) Name() string

Name returns the name of this backend.

func (*InMem) Path

func (m *InMem) Path() string

Path returns inmem.

func (*InMem) Prune

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

Prune removes a directory.

func (*InMem) Pull

func (m *InMem) Pull(ctx context.Context, origin, branch string) error

Pull does nothing.

func (*InMem) Push

func (m *InMem) Push(ctx context.Context, origin, branch string) error

Push does nothing.

func (*InMem) RemoveRemote

func (m *InMem) RemoveRemote(ctx context.Context, remote string) error

RemoveRemote does nothing.

func (*InMem) Revisions

func (m *InMem) Revisions(context.Context, string) ([]backend.Revision, error)

Revisions is not implemented.

func (*InMem) Set

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

Set writes a value.

func (*InMem) Status

func (m *InMem) Status(context.Context) ([]byte, error)

Status is not implemented.

func (*InMem) String

func (m *InMem) String() string

String implement fmt.Stringer.

func (*InMem) TryAdd added in v1.15.10

func (m *InMem) TryAdd(ctx context.Context, args ...string) error

TryAdd does nothing.

func (*InMem) TryCommit added in v1.15.10

func (m *InMem) TryCommit(ctx context.Context, msg string) error

TryCommit does nothing.

func (*InMem) TryPush added in v1.15.10

func (m *InMem) TryPush(ctx context.Context, origin, branch string) error

TryPush does nothing.

func (*InMem) Version

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

Version returns the version of this backend.

Jump to

Keyboard shortcuts

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