dataview

package
v0.16.0-beta02 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKvViewValueIsNotAString = errors.New("value is not a string")
	ErrKvViewEntryNotFound     = errors.New("entry not found")
)

Functions

This section is empty.

Types

type FasthttpArgsKeysValuesCollector

type FasthttpArgsKeysValuesCollector struct {
	Args   *fasthttp.Args
	Prefix string
}

FasthttpArgsKeysValuesCollector implements KvCollector. FasthttpArgsKeysValuesCollector collects values whose key have given prefix as raw string.

func (FasthttpArgsKeysValuesCollector) CollectKeysValues

func (fakvc FasthttpArgsKeysValuesCollector) CollectKeysValues() (keys, values []string)

collectKeysValues implements keysValuesCollector.

type FasthttpArgsKvView

type FasthttpArgsKvView struct {
	Args *fasthttp.Args
}

FasthttpArgsKvView is KvView implementation based on *fasthttp.Args.

func (FasthttpArgsKvView) GetString

func (fakv FasthttpArgsKvView) GetString(key string) (string, error)

type JsonKvCollector

type JsonKvCollector struct {
	Json []byte
	Path string
}

JsonKvCollector collects keys and values from a JSON object. Values are raw JSON encoded value: string values will contains quotes.

func (JsonKvCollector) CollectKeysValues

func (jkc JsonKvCollector) CollectKeysValues() (keys, values []string)

CollectKeysValues implements KvCollector. JsonKvCollector collects values as raw JSON encoded string: string value will contains quotes.

type JsonKvView

type JsonKvView struct {
	Json []byte
}

JsonKvView is a KvView implementation over a JSON object.

func (JsonKvView) GetString

func (jkv JsonKvView) GetString(key string) (string, error)

GetString implements KvView.

type KvCollector

type KvCollector interface {
	CollectKeysValues() (keys, values []string)
}

KvCollector define objects that can collect a set of keys and values.

type KvView

type KvView interface {
	GetString(string) (string, error)
}

KvView is a view over a set of key values.

Jump to

Keyboard shortcuts

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