config

package
v0.0.0-...-0bc2699 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChecksumAlgorithm

type ChecksumAlgorithm string

ChecksumAlgorithm is the YAML configuration representation of a configured checksum algorithm.

const (
	// ChecksumAlgorithmCRC32 is the YAML configuration representation of the
	// CRC32 checksum algorithm.
	ChecksumAlgorithmCRC32 ChecksumAlgorithm = "CRC32"
)

func (ChecksumAlgorithm) ToInternal

func (a ChecksumAlgorithm) ToInternal() store.ChecksumAlgorithm

ToInternal converts the YAML represetnation of a checksum algorithm to the equivalent internal represenation.

type Config

type Config struct {
	NumThreads  int          `yaml:"num_threads"`
	Lockfile    string       `yaml:"lock_file"`
	Logging     LogConfig    `yaml:"logging"`
	Registry    RegConfig    `yaml:"registry"`
	Store       StoreConfig  `yaml:"store"`
	Uploads     UploadConfig `yaml:"uploads"`
	Directories []DirConfig  `yaml:"directories"`
}

Config contains all configuration necessary for the application to run.

type DirConfig

type DirConfig struct {
	Bucket       string       `yaml:"bucket"`
	Path         string       `yaml:"path"`
	StorageClass StorageClass `yaml:"storage_class"`
}

DirConfig contains all configuration required to configure a directory for upload.

type LogConfig

type LogConfig struct {
	Level    LogLevel `yaml:"level"`
	FilePath string   `yaml:"file_path"`
}

LogConfig contains all configuration relating to logs.

type LogLevel

type LogLevel string

LogLevel is the YAML configuration representation of the configured log level.

const (
	LogLevelDebug    LogLevel = "DEBUG"
	LogLevelInfo     LogLevel = "INFO"
	LogLevelWarning  LogLevel = "WARNING"
	LogLevelError    LogLevel = "ERROR"
	LogLevelCritical LogLevel = "DEBUG"
)

func (LogLevel) ToInternal

func (l LogLevel) ToInternal() zapcore.Level

ToInternal converts the YAML representation of a log level to the equivalent internal representation.

type RegConfig

type RegConfig struct {
	Location string `yaml:"location"`
}

RegConfig contains all configuration relating to the file registry.

type StorageClass

type StorageClass string

StorageClass is the YAML configuration representation of a configured storage class.

const (
	// StorageClassStandard denotes the standard storage backend object class.
	StorageClassStandard StorageClass = "STANDARD"
	// StorageClassArchiveFlexi denotes long-term backend storage with read
	// times ranging from minutes to 12 hours.
	StorageClassArchiveFlexi StorageClass = "ARCHIVE_FLEXI"
	// StorageClassArchiveDeep denotes long-term backend storage with long read
	// times between 12 and 48 hours.
	StorageClassArchiveDeep StorageClass = "ARCHIVE_DEEP"
	// StorageClassArchiveInstant denotes long-term backend storage with instant
	// access reads.
	StorageClassArchiveInstant StorageClass = "ARCHIVE_INSTANT"
)

func (StorageClass) ToInternal

func (c StorageClass) ToInternal() store.StorageClass

ToInternal converts the YAML represetnation of a storage class to the equivalent internal represenation.

type StoreConfig

type StoreConfig struct {
	Region           string            `yaml:"region"`
	Endpoint         string            `yaml:"endpoint"`
	UsePathStyle     bool              `yaml:"use_path_style"`
	DisableTLSChecks bool              `yaml:"disable_tls_checks"`
	Credentials      *StoreCredentials `yaml:"credentials"`
}

StoreConfig contains all configuration relating to the file store.

type StoreCredentials

type StoreCredentials struct {
	ID     string `yaml:"id"`
	Secret string `yaml:"secret"`
	Token  string `yaml:"token"`
}

StoreCredentials contains the credentials required to authenticate with the file store.

type UploadConfig

type UploadConfig struct {
	MultiUploadThreshold int64             `yaml:"multi_upload_threshold"`
	ChecksumAlgorithm    ChecksumAlgorithm `yaml:"checksum_algorithm"`
}

UploadConfig contains all configuration common to all file uploads.

Jump to

Keyboard shortcuts

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