corestorage

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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

Alert is an interface for Alert storage

type AlertMock

type AlertMock struct {
	mock.Mock
}

AlertMock represents mock for Alert storage

func (*AlertMock) Get

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

Get returns alert from the storage

func (*AlertMock) Index added in v0.7.0

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

Index returns alerts list

func (*AlertMock) Update added in v0.7.0

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

Update the alert

type CoreStorage

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

CoreStorage is an interface for the CoreStorage

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

KV is an interface for KV storage

type KVMock

type KVMock struct {
	mock.Mock
}

KVMock represents KV mock storage

func (*KVMock) All

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

All returns all KV pairs

func (*KVMock) Delete

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

Delete KV pair from the storage

func (*KVMock) Get

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

Get returns KV pair by name

func (*KVMock) Put

func (m *KVMock) Put(v1, v2 string) error

Put KV pair to the storage

func (*KVMock) Upsert

func (m *KVMock) Upsert(v1, v2 string) error

Upsert KV pair in the storage

type Mock

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

Mock is the mock for the CoreStorage

func NewMock

func NewMock(name string) *Mock

NewMock creates new Mock

func (*Mock) Alert

func (m *Mock) Alert() Alert

Alert return Alert storage

func (*Mock) AlertMock

func (m *Mock) AlertMock() *AlertMock

AlertMock returns Alert storage from the Core

func (*Mock) KV

func (m *Mock) KV() KV

KV returns KV storage

func (*Mock) KVMock

func (m *Mock) KVMock() *KVMock

KVMock returns KV storage from the Core

func (*Mock) Name

func (m *Mock) Name() string

Name returns storage name

func (*Mock) Stop

func (m *Mock) Stop() error

Stop the mock

Directories

Path Synopsis
provider
sql

Jump to

Keyboard shortcuts

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