badm

package module
v0.0.0-...-ac33875 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPlugin

func AddPlugin(configurationPath, path string) error

AddPlugin adds the provided plugin.

func Clear

func Clear(configurationPath, name string) error

Clear clears the bucket configuration.

func ListBuckets

func ListBuckets(configurationPath string) error

ListBuckets lists the buckets in the database.

func ListKeyValues

func ListKeyValues(configurationPath, name string) error

ListKeyValues lists the keys and values in the provided bucket.

func ListKeys

func ListKeys(configurationPath, name string) error

ListKeys lists the keys in the provided bucket.

func ListPlugins

func ListPlugins(configurationPath string) error

ListPlugins prints a list of plugins.

func ListValues

func ListValues(configurationPath, name string) error

ListValues lists the values in the provided bucket.

func RegisterType

func RegisterType(name string, t Type) error

RegisterType adds a new type to the type-list.

func RegisterTypes

func RegisterTypes(configurationPath string) error

RegisterTypes registers all types from all plugins.

func Select

func Select(configurationPath, path string) error

Select selects the provided file is it exists.

func SetKeyType

func SetKeyType(configurationPath, name, value string) error

SetKeyType sets the key type for the provided bucket.

func SetValueType

func SetValueType(configurationPath, name, value string) error

SetValueType sets the value type for the provided bucket.

func TypeNames

func TypeNames() []string

TypeNames returns all possible type names.

Types

type Bucket

type Bucket struct {
	KeyType   string `json:"key_type,omitempty"`
	ValueType string `json:"value_type,omitempty"`
}

Bucket handles the bucket configuration.

type Configuration

type Configuration struct {
	SelectedPath string             `json:"selected_path"`
	Buckets      map[string]*Bucket `json:"buckets"`
	Plugins      []*Plugin          `json:"plugins"`
}

Configuration handles the badm configuration file.

func (*Configuration) KeyType

func (c *Configuration) KeyType(name string) string

KeyType returns the key type for the provided bucket. The default type is returned, if no key type is specified.

func (*Configuration) ValueType

func (c *Configuration) ValueType(name string) string

ValueType returns the value type for the provided bucket. The default type is returned, if no value type is specified.

type Plugin

type Plugin struct {
	Path string `json:"path"`
}

Plugin hanles the plugin configuration.

type Type

type Type func([]byte) (string, error)

Type defines a mapping of a byte-value to a string-representation.

func TypeFor

func TypeFor(name string) (Type, error)

TypeFor returns the type with the provided name.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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