kv

package module
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 8 Imported by: 1

README

Documentation

Index

Constants

View Source
const (
	// PluginName linked to the memory, boltdb, memcached, redis plugins. DO NOT change w/o sync.
	PluginName string = "kv"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Data map[string]any `mapstructure:"kv"`
}

Config represents general storage configuration with keys as the user defined kv-names and values as the constructors

type Configurer

type Configurer interface {
	// UnmarshalKey takes a single key and unmarshal it into a Struct.
	UnmarshalKey(name string, out any) error
	// Has checks if a config section exists.
	Has(name string) bool
}

type Item

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

func (*Item) Key

func (i *Item) Key() string

func (*Item) Timeout

func (i *Item) Timeout() string

func (*Item) Value

func (i *Item) Value() []byte

type Logger

type Logger interface {
	NamedLogger(name string) *zap.Logger
}

type Plugin

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

Plugin for unified storage

func (*Plugin) Collects

func (p *Plugin) Collects() []*dep.In

Collects will get all plugins that implement the Storage interface

func (*Plugin) Init

func (p *Plugin) Init(cfg Configurer, log Logger) error

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) RPC

func (p *Plugin) RPC() any

RPC returns associated rpc service.

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop(ctx context.Context) error

func (*Plugin) Weight

func (p *Plugin) Weight() uint

type Tracer

type Tracer interface {
	Tracer() *sdktrace.TracerProvider
}

Tracer represents opentelemetry tracer (OTEL plugin)

Jump to

Keyboard shortcuts

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