config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const ExtensionRegex = `gz|xz`

Variables

View Source
var SampleConfig string

Functions

This section is empty.

Types

type Compression

type Compression struct {
	Format CompressionFormat
	Level  *int `yaml:",omitempty"`
}

Compression is an immutable type that specifies a compression format and level.

func NewSpecWithLevel

func NewSpecWithLevel(format CompressionFormat, level int) Compression

func (Compression) Equal

func (spec Compression) Equal(other Compression) bool

func (Compression) Equals

func (spec Compression) Equals(other Compression) bool

func (Compression) LevelActual

func (spec Compression) LevelActual() int

func (Compression) NewReader

func (spec Compression) NewReader(r io.Reader) (io.ReadCloser, error)

func (Compression) NewWriter

func (spec Compression) NewWriter(w io.Writer) io.WriteCloser

type CompressionFormat

type CompressionFormat int
const (
	Gzip CompressionFormat = 0
	Xz   CompressionFormat = 1
)

func NewFormatFromExtension

func NewFormatFromExtension(extension string) (CompressionFormat, bool)

func NewFormatFromId

func NewFormatFromId(id string) (CompressionFormat, bool)

func (*CompressionFormat) Extension

func (format *CompressionFormat) Extension() string

func (CompressionFormat) MarshalYAML

func (format CompressionFormat) MarshalYAML() (interface{}, error)

func (*CompressionFormat) String

func (format *CompressionFormat) String() string

func (*CompressionFormat) UnmarshalYAML

func (format *CompressionFormat) UnmarshalYAML(unmarshal func(interface{}) error) error

type Config

type Config struct {
	Port          int
	WorkspacePath string `yaml:"workspacePath"`

	Feeds          []Feed
	ObjectStorage  []ObjectStorage `yaml:"objectStorage"`
	Secrets        []string
	DisableMerging bool `yaml:"disableMerging"`
	PacksPerHour   int  `yaml:"packsPerHour"`
	UploadsPerHour int  `yaml:"uploadsPerHour"`
	Sync           bool
	LogLevel       string `yaml:"logLevel"`
}

func NewConfig

func NewConfig(b []byte) (*Config, error)

func NewConfigWithDefaults

func NewConfigWithDefaults() *Config

func (*Config) LogLevelParsed

func (c *Config) LogLevelParsed() logrus.Level

func (*Config) String

func (c *Config) String() string

type Feed

type Feed struct {
	ID          string
	UserPrefix  *string `yaml:"prefix,omitempty"`
	Postfix     string
	Periodicity time.Duration
	URL         string
	Headers     map[string]string
	Compression Compression
}

func (*Feed) Prefix

func (f *Feed) Prefix() string

type ObjectStorage

type ObjectStorage struct {
	Endpoint   string
	AccessKey  string `yaml:"accessKey"`
	SecretKey  string `yaml:"secretKey"`
	BucketName string `yaml:"bucketName"`
	Prefix     string
	Insecure   bool
}

Jump to

Keyboard shortcuts

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