ctrl

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseController

type BaseController struct {
	Environment string
	// contains filtered or unexported fields
}

func (*BaseController) CloseLogs added in v1.15.0

func (c *BaseController) CloseLogs(ctx context.Context) error

CloseLogs pushes the logs still buffered for Promtail. Call it before the process exits, after the last log line worth keeping.

func (*BaseController) LoadEnvVarsAndConfig

func (c *BaseController) LoadEnvVarsAndConfig(envVarsOutput, configOutput any, configOpts ...configurator.Option) error

func (*BaseController) WithPostgres

func (c *BaseController) WithPostgres(cfg *postgres.ConnectionConfig, models []interface{}, options ...relational.Option) (*relational.DB, error)

func (*BaseController) WithPromtail added in v1.6.1

func (c *BaseController) WithPromtail(params *promtail.WithPromtailParams) error

func (*BaseController) WithS3

func (c *BaseController) WithS3(ctx context.Context, cfg *s3.Config, S3SecretKey string, opts ...s3.ClientOption) (*s3.Client, error)

func (*BaseController) WithSES

func (c *BaseController) WithSES(ctx context.Context, cfg *ses.Config, AWSSecretKey string) (*ses.Client, error)

func (*BaseController) WithSQLite added in v1.10.0

func (c *BaseController) WithSQLite(cfg *sqlite.ConnectionConfig, models []interface{}, options ...relational.Option) (*relational.DB, error)

WithSQLite - Opens a SQLite database and creates the schema from the model structs if it doesn't already exist.

func (*BaseController) WithZerolog added in v1.6.1

func (c *BaseController) WithZerolog(configure ...func(*zerolog.ConsoleWriter))

WithZerolog installs a zerolog.ConsoleWriter on the global logger. The default layout colors each name=value field as one span (see consoleFieldName). Each configure function then runs, in order, on the writer before it is installed, so an app can override fields such as NoColor, TimeFormat or the field formatters and own its own layout. Nil configure functions are skipped.

The default FormatFieldName opens a color span that only the default FormatFieldValue closes, so replace the two together, and likewise FormatErrFieldName and FormatErrFieldValue. Replacing only one leaves the span unclosed or prints a stray reset.

Do not replace Out: it is the Promtail writer when WithPromtail enabled it, and replacing it stops forwarding lines to Loki and skips the flush on Fatal. To wrap it, keep writing through the original w.Out.

Jump to

Keyboard shortcuts

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