controller

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CONFIG_DIR = ".agent_composer/config"
View Source
const DEFAULT_LOCALE = "en-US"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppSettings

type AppSettings struct {
	Name            string
	Port            string
	Debug           bool
	Version         string
	RateLimit       int // In requests
	RateLimitWindow int // In seconds
}

type Config

type Config struct {
	App      AppSettings               `mapstructure:"app"`
	Promtail promtail.Config           `mapstructure:"promtail"`
	Postgres postgres.ConnectionConfig `mapstructure:"postgres"`
}

ConfigSettings contains the config.yml settings

type Controller

type Controller struct {
	ctrl.BaseController
	Config  Config
	EnvVars EnvVars
	DB      *relational.DB
}

func New

func New() (*Controller, error)

func (*Controller) Setup

func (controller *Controller) Setup() error

type EnvVars

type EnvVars struct {
	Environment              string
	ProjectRootPath          string
	PromtailPassword         string ` mapstucture:"PROMTAIL_PASSWORD"`
	PostgresPassword         string ` mapstucture:"POSTGRES_PASSWORD"`
	AWSSecretKey             string ` mapstucture:"AWS_SECRET_KEY"`
	S3SecretKey              string ` mapstucture:"S3_SECRET_KEY"`
	STPSecretKey             string ` mapstucture:"STP_SECRET_KEY"`
	STPGatewayToken          string ` mapstucture:"STP_GATEWAY_TOKEN"`
	FacturamaPassword        string ` mapstucture:"FACTURAMA_PASSWORD"`
	HikDeviceGatewayPassword string ` mapstucture:"HIK_DEVICE_GATEWAY_PASSWORD"`
}

type I18n

type I18n struct {
	Bundle *i18n.Bundle
}

func (*I18n) String

func (t *I18n) String(locale Locale, key string) (string, error)

func (*I18n) Template

func (t *I18n) Template(locale Locale, key string, data map[string]interface{}) (string, error)

type Language

type Language string

Language represents supported languages

const (
	English Language = "en"
	Spanish Language = "es"
)

func (Language) IsValid

func (l Language) IsValid() bool

type Locale

type Locale string

Locale is a string type with validation

func NewLocaleString

func NewLocaleString(locale string) (Locale, error)

NewLocaleString creates a validated locale string

func (Locale) Language

func (l Locale) Language() Language

Language returns the language part of the locale

func (Locale) MarshalJSON

func (l Locale) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (Locale) Region

func (l Locale) Region() string

Region returns the region part of the locale

func (Locale) String

func (l Locale) String() string

String returns the locale string

func (*Locale) UnmarshalJSON

func (l *Locale) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

Jump to

Keyboard shortcuts

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