mock

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mock implements an in-memory mock backend for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend implements a mock backend.

func New

func New() *Backend

New opens a mock backend

func (*Backend) Acquire

func (b *Backend) Acquire(_ context.Context, owner, namespace, name string, exp time.Time, metadata map[string]string) (*backend.HandleData, error)

Acquire implements the backend.Backend interface.

func (*Backend) Close

func (*Backend) Close() error

Close implements the backend.Backend interface.

func (*Backend) Done

func (b *Backend) Done(_ context.Context, owner string, handleID uuid.UUID, metadata map[string]string) error

Done implements the backend.Backend interface.

func (*Backend) Get

func (b *Backend) Get(_ context.Context, handleID uuid.UUID) (*backend.HandleData, error)

Get returns the stored handle data.

func (*Backend) List

func (b *Backend) List(_ context.Context, req *rpc.ListRequest, iter backend.Iterator) error

List implements the backend.Backend interface.

func (*Backend) Ping added in v0.4.3

func (*Backend) Ping() error

Ping implements the backend.Backend interface.

func (*Backend) Renew

func (b *Backend) Renew(_ context.Context, owner string, handleID uuid.UUID, exp time.Time, metadata map[string]string) error

Renew implements the backend.Backend interface.

Jump to

Keyboard shortcuts

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