config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig

type AdminConfig struct {
	AuthorizedKeys []string
	Tinylogs       []TinylogConfig
	Test           bool
}

type ConfigValue added in v0.2.0

type ConfigValue struct {
	Type  ConfigValueType `cty:"type"`
	Value string          `cty:"value"`
}

func CreateEnvConfigValue added in v0.2.0

func CreateEnvConfigValue(val string) *ConfigValue

func CreateFileConfigValue added in v0.2.0

func CreateFileConfigValue(val string) *ConfigValue

type ConfigValueType added in v0.2.0

type ConfigValueType int
const (
	EnvType ConfigValueType = iota
	FileType
)

type FSSourceConfig

type FSSourceConfig struct {
	Root string
}

type File

type File struct {
	CertRoot string
	Servers  []ServerConfig
	Plugins  map[string]PluginConfig
}

func LoadConfig

func LoadConfig(filename string) (*File, error)

func Parse

func Parse(src []byte, filename string, getEnv GetEnvFunc) (*File, hcl.Diagnostics)

func ParseString

func ParseString(src string, filename string) (*File, hcl.Diagnostics)

func ParseStringWithEnv added in v0.2.0

func ParseStringWithEnv(src string, filename string, getEnv GetEnvFunc) (*File, hcl.Diagnostics)

type GetEnvFunc added in v0.2.0

type GetEnvFunc = func(string) string

type HTTPProxyConfig

type HTTPProxyConfig struct {
	Enabled bool
	Port    int
}

type LocationConfig

type LocationConfig struct {
	Path       string
	PluginPass string

	// Sources
	FSSource  *FSSourceConfig
	S3Source  *S3SourceConfig
	MemSource *MemorySourceConfig

	Admin     *AdminConfig
	Locations []LocationConfig
	HTTPProxy HTTPProxyConfig
}

func (*LocationConfig) AppendLocation

func (l *LocationConfig) AppendLocation(lc LocationConfig)

func (*LocationConfig) GetAdmin

func (l *LocationConfig) GetAdmin() *AdminConfig

func (*LocationConfig) GetFSSource

func (l *LocationConfig) GetFSSource() *FSSourceConfig

func (*LocationConfig) GetHTTPProxy

func (l *LocationConfig) GetHTTPProxy() HTTPProxyConfig

func (*LocationConfig) GetLocations

func (l *LocationConfig) GetLocations() []LocationConfig

func (*LocationConfig) GetMemSource

func (l *LocationConfig) GetMemSource() *MemorySourceConfig

func (*LocationConfig) GetS3Source

func (l *LocationConfig) GetS3Source() *S3SourceConfig

func (*LocationConfig) SetAdmin

func (l *LocationConfig) SetAdmin(ad *AdminConfig)

func (*LocationConfig) SetFSSource

func (l *LocationConfig) SetFSSource(fss *FSSourceConfig)

func (*LocationConfig) SetHTTPProxy

func (l *LocationConfig) SetHTTPProxy(p HTTPProxyConfig)

func (*LocationConfig) SetMemSource

func (l *LocationConfig) SetMemSource(ms *MemorySourceConfig)

func (*LocationConfig) SetS3Source

func (l *LocationConfig) SetS3Source(s3s *S3SourceConfig)

type LocationOrServer

type LocationOrServer interface {
	// Sources
	GetFSSource() *FSSourceConfig
	SetFSSource(*FSSourceConfig)
	GetS3Source() *S3SourceConfig
	SetS3Source(*S3SourceConfig)
	GetMemSource() *MemorySourceConfig
	SetMemSource(*MemorySourceConfig)

	GetAdmin() *AdminConfig
	SetAdmin(*AdminConfig)

	GetHTTPProxy() HTTPProxyConfig
	SetHTTPProxy(p HTTPProxyConfig)

	GetLocations() []LocationConfig
	AppendLocation(LocationConfig)
}

type MastodonServiceConfig added in v0.2.0

type MastodonServiceConfig struct {
	APIKey string
	Server string
}

type MemorySourceConfig

type MemorySourceConfig struct {
	ID string
}

type PluginConfig

type PluginConfig struct {
	Name string
	Cmd  string
}

type S3SourceConfig

type S3SourceConfig struct {
	Bucket string
	Region string
}

type ServerConfig

type ServerConfig struct {
	Host string

	// Sources
	FSSource  *FSSourceConfig
	S3Source  *S3SourceConfig
	MemSource *MemorySourceConfig
	Admin     *AdminConfig
	HTTPProxy HTTPProxyConfig

	TLSCert   string
	TLSKey    string
	Locations []LocationConfig
}

func (*ServerConfig) AppendLocation

func (s *ServerConfig) AppendLocation(l LocationConfig)

func (*ServerConfig) GetAdmin

func (s *ServerConfig) GetAdmin() *AdminConfig

func (*ServerConfig) GetFSSource

func (s *ServerConfig) GetFSSource() *FSSourceConfig

func (*ServerConfig) GetHTTPProxy

func (s *ServerConfig) GetHTTPProxy() HTTPProxyConfig

func (*ServerConfig) GetLocations

func (s *ServerConfig) GetLocations() []LocationConfig

func (*ServerConfig) GetMemSource

func (s *ServerConfig) GetMemSource() *MemorySourceConfig

func (*ServerConfig) GetS3Source

func (s *ServerConfig) GetS3Source() *S3SourceConfig

func (*ServerConfig) SetAdmin

func (s *ServerConfig) SetAdmin(ad *AdminConfig)

func (*ServerConfig) SetFSSource

func (s *ServerConfig) SetFSSource(fss *FSSourceConfig)

func (*ServerConfig) SetHTTPProxy

func (s *ServerConfig) SetHTTPProxy(p HTTPProxyConfig)

func (*ServerConfig) SetMemSource

func (s *ServerConfig) SetMemSource(ms *MemorySourceConfig)

func (*ServerConfig) SetS3Source

func (s *ServerConfig) SetS3Source(s3s *S3SourceConfig)

type SourceConfig

type SourceConfig struct {
}

type TinylogConfig

type TinylogConfig struct {
	Path  string
	Label string

	// Crosspost services
	Mastodons []MastodonServiceConfig
}

Jump to

Keyboard shortcuts

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