config

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvFunc = function.New(&function.Spec{
	Description: "Returns the environment variable.",
	Params: []function.Parameter{
		{
			Name:             "key",
			Type:             cty.String,
			AllowDynamicType: true,
		},
	},
	Type: function.StaticReturnType(cty.Tuple([]cty.Type{cty.String, cty.String})),
	Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) {
		in := args[0].AsString()
		t := cty.TupleVal([]cty.Value{cty.StringVal("env"), cty.StringVal(in)})
		return t, nil
	},
})

Functions

This section is empty.

Types

type AdminConfig

type AdminConfig struct {
	AuthorizedKeys []fs.UnderlyingValue
	Tinylogs       []TinylogConfig
	Test           bool
}

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) (*File, hcl.Diagnostics)

func ParseString

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

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 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
	TLSCertEnv string
	TLSKeyEnv  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) HasTLSCertEnvs

func (s *ServerConfig) HasTLSCertEnvs() bool

func (*ServerConfig) HasTLSCertFiles

func (s *ServerConfig) HasTLSCertFiles() bool

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
}

Jump to

Keyboard shortcuts

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