app

package
v0.0.0-...-f328a8e Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupLogger

func SetupLogger(cfg *Config) *slog.Logger

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(cfg *Config) (*App, error)

func (*App) Run

func (a *App) Run() error

type Config

type Config struct {
	NatsURL           string `env:"NATS_URL" envDefault:"nats://localhost:4222" validate:"required,url"`
	NatsInputSubject  string `env:"NATS_INPUT_SUBJECT" envDefault:"rules.engine.input" validate:"required"`
	NatsOutputSubject string `env:"NATS_OUTPUT_SUBJECT" envDefault:"rules.engine.output" validate:"required"`
	NatsInputStream   string `env:"NATS_INPUT_STREAM" envDefault:"RULES_INPUT" validate:"required"`
	NatsOutputStream  string `env:"NATS_OUTPUT_STREAM" envDefault:"RULES_OUTPUT" validate:"required"`
	LogLevel          string `env:"LOG_LEVEL" envDefault:"info" validate:"oneof=debug info warn error"`
}

func LoadConfig

func LoadConfig() (*Config, error)

Jump to

Keyboard shortcuts

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