Documentation ¶
Overview ¶
Package badger provides a configurable BadgerDB go-datastore for use with IPFS Cluster.
Index ¶
- Constants
- Variables
- func Cleanup(cfg *Config) error
- func New(cfg *Config) (ds.Datastore, error)
- type Config
- func (cfg *Config) ApplyEnvVars() error
- func (cfg *Config) ConfigKey() string
- func (cfg *Config) Default() error
- func (cfg *Config) GetFolder() string
- func (cfg *Config) LoadJSON(raw []byte) error
- func (cfg *Config) ToDisplayJSON() ([]byte, error)
- func (cfg *Config) ToJSON() (raw []byte, err error)
- func (cfg *Config) Validate() error
Constants ¶
View Source
const (
DefaultSubFolder = "badger"
)
Default values for badger Config
Variables ¶
View Source
var ( // DefaultBadgerOptions has to be a var because badger.DefaultOptions // is. Values are customized during Init(). DefaultBadgerOptions badger.Options )
Functions ¶
Types ¶
type Config ¶
type Config struct { config.Saver // The folder for this datastore. Non-absolute paths are relative to // the base configuration folder. Folder string BadgerOptions badger.Options }
Config is used to initialize a BadgerDB datastore. It implements the ComponentConfig interface.
func (*Config) ApplyEnvVars ¶
ApplyEnvVars fills in any Config fields found as environment variables.
func (*Config) ConfigKey ¶
ConfigKey returns a human-friendly identifier for this type of Datastore.
func (*Config) LoadJSON ¶
LoadJSON reads the fields of this Config from a JSON byteslice as generated by ToJSON.
func (*Config) ToDisplayJSON ¶ added in v0.13.0
ToDisplayJSON returns JSON config as a string.
Click to show internal directories.
Click to hide internal directories.