corestorage

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlertNotFound = errors.New("alert not found")
)

Functions

This section is empty.

Types

type Alert

type Alert interface {
	// Update exists alert or create new
	Update(name string, level alert.Level) (*alert.Alert, bool, error)
	Index(levels []alert.Level) (alert.Alerts, error)
	Get(name string) (*alert.Alert, error)
}

type AlertMock

type AlertMock struct {
	mock.Mock
}

func (*AlertMock) Get

func (m *AlertMock) Get(name string) (*alert.Alert, error)

func (*AlertMock) Index added in v0.7.0

func (m *AlertMock) Index(levels []alert.Level) (alert.Alerts, error)

func (*AlertMock) Update added in v0.7.0

func (m *AlertMock) Update(name string, level alert.Level) (*alert.Alert, bool, error)

type CoreStorage

type CoreStorage interface {
	Name() string
	KV() KV
	Alert() Alert
	Stop() error
}

type KV

type KV interface {
	Put(string, string) error
	Get(string) (string, error)
	Upsert(string, string) error
	Delete(string) error
	All() (map[string]string, error)
}

type KVMock

type KVMock struct {
	mock.Mock
}

func (*KVMock) All

func (m *KVMock) All() (map[string]string, error)

func (*KVMock) Delete

func (m *KVMock) Delete(_ string) error

func (*KVMock) Get

func (m *KVMock) Get(_ string) (string, error)

func (*KVMock) Put

func (m *KVMock) Put(_, _ string) error

func (*KVMock) Upsert

func (m *KVMock) Upsert(_, _ string) error

type Mock

type Mock struct {
	mock.Mock
	// contains filtered or unexported fields
}

func NewMock

func NewMock(name string) *Mock

func (*Mock) Alert

func (m *Mock) Alert() Alert

func (*Mock) AlertMock

func (m *Mock) AlertMock() *AlertMock

func (*Mock) KV

func (m *Mock) KV() KV

func (*Mock) KVMock

func (m *Mock) KVMock() *KVMock

func (*Mock) Name

func (m *Mock) Name() string

func (*Mock) Stop

func (m *Mock) Stop() error

Directories

Path Synopsis
provider
sql

Jump to

Keyboard shortcuts

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