config

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSKey

type AWSKey struct {
	AccessKey string `name:"accesskey"`
	SecretKey string `name:"secretkey"`
}

func (*AWSKey) Decode

func (k *AWSKey) Decode(ctx *kong.DecodeContext) error

type CLI

type CLI struct {
	Server ServerCommand `cmd:"server" help:"Run queue server"`
	Tester TesterCommand `cmd:"tester" help:"Run queue test tool"`

	Config kong.ConfigFlag `name:"config" help:"Configuration file"`
	Log    LogConfig       `embed:"" prefix:"log-" name:"log" envprefix:"LOG_"`
}

func Load

func Load() (string, *CLI, error)

type DashboardConfig

type DashboardConfig struct {
	Enabled bool   `name:"enabled" help:"Enable web dashboard" default:"true" env:"ENABLED"`
	Port    int    `name:"port" help:"HTTP port for dashboard" default:"3000" env:"PORT"`
	Dev     bool   `name:"dev" help:"Run dashboard in dev mode, refresh templates from local" default:"false" env:"DEV"`
	User    string `name:"user" help:"Username for auth" default:"" env:"USER"`
	Pass    string `name:"pass" help:"Pass for auth" default:"" env:"PASS"`
}

type LogConfig

type LogConfig struct {
	Pretty bool   `name:"pretty" default:"true" env:"PRETTY"`
	Level  string `name:"level" enum:"trace,debug,info,warn,error,fatal,panic" default:"info" help:"Log level" env:"LEVEL"`
}

type MetricsConfig added in v0.1.1

type MetricsConfig struct {
	PrometheusEnabled bool   `name:"prometheus-enabled" default:"true" env:"PROMETHEUS_ENABLED"`
	PrometheusPort    int    `name:"prometheus-port" default:"2112" env:"PROMETHEUS_PORT"`
	PrometheusPath    string `name:"prometheus-path" default:"/metrics" env:"PROMETHEUS_PATH"`
}

type SQLiteConfig

type SQLiteConfig struct {
	Path string `name:"path" help:"Path of SQLite file" default:"smoothmq.sqlite" env:"PATH"`
}

type SQSConfig

type SQSConfig struct {
	Enabled          bool     `name:"enabled" default:"true" help:"Enable SQS protocol for queue" env:"ENABLED"`
	Port             int      `name:"port" default:"3001" help:"HTTP port for SQS protocol" env:"PORT"`
	Keys             []AWSKey `name:"keys" default:"DEV_ACCESS_KEY_ID:DEV_SECRET_ACCESS_KEY" env:"KEYS"`
	ParseCelery      bool     `` /* 135-byte string literal not displayed */
	MaxRequestSize   int      `name:"max-request-size" default:"1048576" env:"MAX_REQUEST_SIZE" help:"Max size of SQS request in bytes"`
	MaxDelaySeconds  int      `name:"max-delay-seconds" default:"30" env:"MAX_DELAY_SECONDS" help:"Max allowed wait time for long polling"`
	DelayRetryMillis int      `name:"delay-retry-millis" default:"1000" env:"DELAY_RETRY_MILLIS" help:"When long polling, how often to request new items"`
	EndpointOverride string   `` /* 130-byte string literal not displayed */
}

type ServerCommand

type ServerCommand struct {
	SQS       SQSConfig       `embed:"" prefix:"sqs-" envprefix:"Q_SQS_"`
	Dashboard DashboardConfig `embed:"" prefix:"dashboard-" envprefix:"Q_DASHBOARD_"`
	SQLite    SQLiteConfig    `embed:"" prefix:"sqlite-" envprefix:"Q_SQLITE_"`
	Metrics   MetricsConfig   `embed:"" prefix:"metrics-" name:"metrics" envprefix:"Q_METRICS_"`

	DisableTelemetry bool `name:"disable-telemetry" default:"false" env:"DISABLE_TELEMETRY"`
	UseSinglePort    bool `` /* 155-byte string literal not displayed */
	Port             int  `name:"port" default:"8080" env:"PORT" help:"If use-single-port is enabled, this is the port number for the server"`
}

type TesterCommand

type TesterCommand struct {
	SqsEndpoint  string `help:"SQS endpoint" name:"endpoint" default:"http://localhost:3001"`
	Senders      int    `help:"" default:"0"`
	Receivers    int    `help:"" default:"0"`
	Messages     int    `help:"" default:"0"`
	BatchSize    int    `help:"" default:"1"`
	DelaySeconds int    `help:"" default:"0"`
	AccessKey    string `help:"" default:"DEV_ACCESS_KEY_ID"`
	SecretKey    string `help:"" default:"DEV_SECRET_ACCESS_KEY"`
}

Jump to

Keyboard shortcuts

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