config

package
v0.0.0-...-1b0f315 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapatersConfig

type AdapatersConfig struct {
	S3    *S3AdapterConfig    `yaml:"s3,omitempty"`
	Redis *RedisAdapterConfig `yaml:"redis,omitempty"`
}

type ApiKeyStorageConfig

type ApiKeyStorageConfig struct {
	Filesystem *string `yaml:"filesystem"`
	Redis      *string `yaml:"redis"`
}

type Config

type Config struct {
	MasterKey string          `yaml:"-"`
	Server    ServerConfig    `yaml:"api,omitempty" validate:"required"`
	Storage   StorageConfig   `yaml:"storage,omitempty" validate:"required"`
	Adapters  AdapatersConfig `yaml:"adapter,omitempty" validate:"required"`
}

func NewConfig

func NewConfig() Config

type FileStorageConfig

type FileStorageConfig struct {
	FilesystemStorageConfig *FilesystemStorageConfig `yaml:"filesystem,omitempty"`
	S3StorageConfig         *S3StorageConfig         `yaml:"s3,omitempty"`
}

type FilesystemStorage

type FilesystemStorage struct {
}

func NewFilesystemStorage

func NewFilesystemStorage() FilesystemStorage

func (*FilesystemStorage) LoadConfig

func (c *FilesystemStorage) LoadConfig() (*Config, error)

func (*FilesystemStorage) SaveConfig

func (c *FilesystemStorage) SaveConfig(config *Config) error

type FilesystemStorageConfig

type FilesystemStorageConfig struct {
	MountDir string `yaml:"mount_dir,omitempty" validate:"required"`
}

type HttpApiConfig

type HttpApiConfig struct {
	Host string `yaml:"host" validate:"required"`
	Port int    `yaml:"port" validate:"required"`
}

type MediaStorageConfig

type MediaStorageConfig struct {
	FileStorage     FileStorageConfig     `yaml:"file" validate:"required"`
	CacheStorage    FileStorageConfig     `yaml:"cache" validate:"required"`
	MetadataStorage MetadataStorageConfig `yaml:"metadata" validate:"required"`
}

type MetadataStorageConfig

type MetadataStorageConfig struct {
	Redis *string `yaml:"redis"`
}

type NamedTransforationStorageConfig

type NamedTransforationStorageConfig struct {
	Filesystem *string `yaml:"filesystem"`
	Redis      *string `yaml:"redis"`
}

type RedisAdapterConfig

type RedisAdapterConfig struct {
	Host     string `yaml:"host,omitempty" validate:"required"`
	Port     int    `yaml:"port,omitempty" validate:"required"`
	Password string `yaml:"password,omitempty" validate:""`
}

type S3AdapterConfig

type S3AdapterConfig struct {
	AccessKeyId     string `yaml:"access_key_id,omitempty" validate:"required"`
	SecretAccessKey string `yaml:"secret_access_key,omitempty" validate:"required"`
	Endpoint        string `yaml:"endpoint,omitempty" validate:"required"`
	Region          string `yaml:"region,omitempty" validate:"required"`
}

type S3StorageConfig

type S3StorageConfig struct {
	Bucket string `yaml:"bucket,omitempty" validate:"required"`
}

type ServerConfig

type ServerConfig struct {
	HttpApiConfig HttpApiConfig `yaml:"http,omitempty" validate:"required"`
}

type StorageConfig

type StorageConfig struct {
	MediaStorage              MediaStorageConfig              `yaml:"media" validate:"required"`
	NamedTransforationStorage NamedTransforationStorageConfig `yaml:"named_transformation" validate:"required"`
	ApiKeyStorage             ApiKeyStorageConfig             `yaml:"apikey" validate:"required"`
	TaskStorage               TaskStorageConfig               `yaml:"task" validate:"required"`
}

type TaskStorageConfig

type TaskStorageConfig struct {
	Filesystem *string `yaml:"filesystem"`
	Redis      *string `yaml:"redis"`
}

Jump to

Keyboard shortcuts

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