config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	URL string `hcl:"url"`
}

type ChunkerConfig added in v0.0.2

type ChunkerConfig struct {
	Min uint32 `hcl:"min,optional"`
	Max uint32 `hcl:"max,optional"`
	// Average chunk size to aim for. Will be rounded to the nearest
	// power of two.
	Average uint32 `hcl:"average,optional"`
}

func (*ChunkerConfig) CASOptions added in v0.0.2

func (c *ChunkerConfig) CASOptions() []cas.Option

CASOptions returns the cas.Option values that enact this configuration. It is safe to call on nil values.

type Config

type Config struct {
	MountPoint string `hcl:"mountpoint"`
	// SymlinkTarget is the prefix path added to symlinks created by `plop add`.
	// Defaults to MountPoint.
	SymlinkTarget string    `hcl:"symlink_target,optional"`
	DefaultVolume string    `hcl:"default_volume,optional"`
	Volumes       []*Volume `hcl:"volume,block"`

	Chunker *ChunkerConfig `hcl:"chunker,block"`
	// contains filtered or unexported fields
}

func ParseConfig

func ParseConfig(filename string, src []byte) (*Config, error)

func ReadConfig

func ReadConfig(p string) (*Config, error)

func (*Config) GetDefaultVolume

func (cfg *Config) GetDefaultVolume() (*Volume, error)

func (*Config) GetVolume

func (cfg *Config) GetVolume(name string) (_ *Volume, ok bool)

type Local added in v0.0.2

type Local struct {
	DefaultVolume string `hcl:"default_volume,optional"`
}

func ReadLocalConfig added in v0.0.2

func ReadLocalConfig() (*Local, error)

ReadLocalConfig reads any local configuration files in the current directory and above it. Files lower in the tree override files in parents.

type Volume

type Volume struct {
	Name       string         `hcl:"volume,label"`
	Passphrase string         `hcl:"passphrase"`
	Bucket     *Bucket        `hcl:"bucket,block"`
	Chunker    *ChunkerConfig `hcl:"chunker,block"`
}

Jump to

Keyboard shortcuts

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