config

package
v0.0.0-...-444b257 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 12 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 {
	Logging struct {
		LogLevel  string `hcl:"log_level"`
		SentryDSN string `hcl:"sentry_dsn"`
	} `hcl:"logging,block"`

	Queue      *QueueConfig      `hcl:"queue,block"`
	HTTPServer *HTTPServerConfig `hcl:"http,block"`
	Macros     []*MacroConfig    `hcl:"macro,block"`
	// contains filtered or unexported fields
}

func BootFromFile

func BootFromFile(filename string) (*Config, error)

func (*Config) LookupMacro

func (config *Config) LookupMacro(name string) (m *MacroConfig, ok bool)

func (*Config) SetupMounts

func (config *Config) SetupMounts() error

type HTTPServerConfig

type HTTPServerConfig struct {
	ListenAddr       string `hcl:"listen"`
	EnableAccessLogs bool   `hcl:"access_logs"`
}

type MacroConfig

type MacroConfig struct {
	Name        string `hcl:"name,label"`
	Command     string `hcl:"command"`
	MaxExecTime string `hcl:"max_execution_time"`
	Mounts      []struct {
		Filename string `hcl:"filename,label"`
		Content  string `hcl:"content"`
	} `hcl:"mount,block"`
}

func (*MacroConfig) ParseAndSplit

func (macro *MacroConfig) ParseAndSplit(ctx map[string]string) ([]string, error)

type QueueConfig

type QueueConfig struct {
	Driver        string `hcl:"driver"`
	DSN           string `hcl:"dsn"`
	WorkersCount  int    `hcl:"workers_count"`
	PollDuration  string `hcl:"poll_duration"`
	RetryAttempts int    `hcl:"retry_attempts"`
	History       struct {
		RetentionPeriod string `hcl:"retention_period"`
	} `hcl:"history,block"`
}

Jump to

Keyboard shortcuts

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