config

package
v1.0.0-next.3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RemoteTrimPolicy RemoteTrimPolicy       `yaml:"remote_trim_policy"`
	LocalTrimPolicy  LocalTrimPolicy        `yaml:"local_trim_policy"`
	Stages           map[string]ConfigStage `yaml:"-" validate:"required,dive"`
	RawStages        map[string]yaml.Node   `yaml:"stages"`
}

type ConfigDriver

type ConfigDriver interface {
	GetZfsDriver() domain.ZfsDriver
	GetStorageDriver() domain.StorageDriver
	GetMiddlewares() []domain.Middleware
	GetConfig() *Config
}

type ConfigRepo

type ConfigRepo interface {
	GetConfig() *Config
	GetMiddlewares() []domain.Middleware
}

type ConfigStage

type ConfigStage interface {
	Remote() string
	Type() ConfigType
}

func NewCryptConfig

func NewCryptConfig() ConfigStage

func NewS3Config

func NewS3Config() ConfigStage

func NewThrottleConfig

func NewThrottleConfig() ConfigStage

func NewZfsConfig

func NewZfsConfig() ConfigStage

type ConfigType

type ConfigType int
const (
	Sink ConfigType = iota
	Middleware
	Source
)

type CryptConfig

type CryptConfig struct {
	Remote_  string `yaml:"remote" validate:"required"`
	Password string `yaml:"password" validate:"required"`
	// contains filtered or unexported fields
}

func (*CryptConfig) Remote

func (c *CryptConfig) Remote() string

func (*CryptConfig) Type

func (c *CryptConfig) Type() ConfigType

type LoadParams

type LoadParams struct {
	ConfigReader      io.Reader
	StageMapping      StageMap
	ZfsDriverFunc     func(c *ZfsConfig) domain.ZfsDriver
	StorageDriverFunc func(s *S3Config) (domain.StorageDriver, error)
	ToMiddleware      func(c ConfigStage) domain.Middleware
}

type LocalTrimPolicy

type LocalTrimPolicy string

func (*LocalTrimPolicy) GetFullCount

func (e *LocalTrimPolicy) GetFullCount() int

func (*LocalTrimPolicy) GetIncrementalCount

func (e *LocalTrimPolicy) GetIncrementalCount() int

type RemoteTrimPolicy

type RemoteTrimPolicy string

func (*RemoteTrimPolicy) GetFullCount

func (e *RemoteTrimPolicy) GetFullCount() int

func (*RemoteTrimPolicy) GetIncrementalCount

func (e *RemoteTrimPolicy) GetIncrementalCount() int

type S3Config

type S3Config struct {
	Bucket         string `yaml:"bucket"`
	Region         string `yaml:"region"`
	UsePathStyle   bool   `yaml:"usePathStyle"`
	BaseEndpoint   string `yaml:"baseEndpoint"`
	Prefix         string `yaml:"prefix"`
	AccessKey      string `yaml:"accessKey"`
	AccessSecret   string `yaml:"accessSecret"`
	MaxRetries     int    `yaml:"maxRetries"`
	UploadPartSize int    `yaml:"uploadPartSize"`
	// contains filtered or unexported fields
}

func (*S3Config) Remote

func (s *S3Config) Remote() string

func (*S3Config) Type

func (s *S3Config) Type() ConfigType

type StageMap

type StageMap = map[string]func() ConfigStage

type ThrottleConfig

type ThrottleConfig struct {
	Remote_    string `yaml:"remote" validate:"required"`
	WriteSpeed int64  `yaml:"writeSpeed" validate:"required"` //TODO: rename to writeSpeedByteSec
	ReadSpeed  int64  `yaml:"readSpeed" validate:"required"`  //TODO: rename to readSpeedByteSec
	// contains filtered or unexported fields
}

func (*ThrottleConfig) Remote

func (t *ThrottleConfig) Remote() string

func (*ThrottleConfig) Type

func (t *ThrottleConfig) Type() ConfigType

type ZfsConfig

type ZfsConfig struct {
	Remote_ string `yaml:"remote" validate:"required"`
	ZfsPath string `yaml:"zfsPath"`
	// contains filtered or unexported fields
}

func (*ZfsConfig) Remote

func (z *ZfsConfig) Remote() string

func (*ZfsConfig) Type

func (z *ZfsConfig) Type() ConfigType

Directories

Path Synopsis
Package mocks_config is a generated GoMock package.
Package mocks_config is a generated GoMock package.

Jump to

Keyboard shortcuts

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