config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Log levels
	LogLevelDebug = "debug"
	LogLevelWarn  = "warn"
	LogLevelError = "error"

	// Default configurations
	DefaultLogLevel = LogLevelWarn
	DefaultVerbose  = "info"
	DefaultRootDir  = "./"

	// Database types
	DatastoreSQLite = "sqlite"

	// Database file
	DefaultDatabaseFile = "aog.db"

	// Directory names
	LogsDirectory = "logs"

	// File names
	ServerLogFile  = "server.log"
	ConsoleLogFile = "console.log"

	// Time formats
	DefaultTimeFormat = "2006-01-02 15:04:05"

	// Log file expiration in days
	DefaultLogExpireDays = 7

	// Environment variable keys
	EnvAOGHost                = "AOG_HOST"
	EnvModelIdleTimeout       = "AOG_MODEL_IDLE_TIMEOUT"
	EnvModelCleanupInterval   = "AOG_MODEL_CLEANUP_INTERVAL"
	EnvLocalModelQueueSize    = "AOG_LOCAL_MODEL_QUEUE_SIZE"
	EnvLocalModelQueueTimeout = "AOG_LOCAL_MODEL_QUEUE_TIMEOUT"
	EnvPluginDir              = "AOG_PLUGIN_DIR"
	EnvEnabledEngines         = "AOG_ENABLED_ENGINES"
)

Variables

This section is empty.

Functions

func Host

func Host() *url.URL

Host returns the scheme and host. Host can be configured via the AOG_HOST environment variable. Default is scheme host and host "127.0.0.1:16688"

func Var

func Var(key string) string

Var returns an environment variable stripped of leading and trailing quotes or spaces

Types

type AOGClient

type AOGClient struct {
	client.Client
}

func NewAOGClient

func NewAOGClient() *AOGClient

type AOGEnvironment

type AOGEnvironment struct {
	ApiHost                string        // host
	Datastore              string        // path to the datastore
	DatastoreType          string        // type of the datastore
	Verbose                string        // debug, info or warn
	RootDir                string        // root directory for all assets such as config files
	APIVersion             string        // version of this core app layer (gateway etc.)
	SpecVersion            string        // version of the core specification this app layer supports
	LogDir                 string        // logs dir
	LogHTTP                string        // path to the http log
	LogLevel               string        // log level
	LogFileExpireDays      int           // log file expiration time
	ConsoleLog             string        // aog server console log path
	ModelIdleTimeout       time.Duration // model idle timeout duration
	ModelCleanupInterval   time.Duration // model cleanup check interval
	LocalModelQueueSize    int           // local model queue size
	LocalModelQueueTimeout time.Duration // local model queue timeout
	PluginDir              string        // plugin directory path
	EnabledEngines         []string      // list of enabled engines (empty means all)
}
var GlobalEnvironment *AOGEnvironment

func NewAOGEnvironment

func NewAOGEnvironment() *AOGEnvironment

func (*AOGEnvironment) Flags

func (s *AOGEnvironment) Flags() *FlagSets

Flags returns the flag sets for the AOGEnvironment.

func (*AOGEnvironment) SetSlogColor

func (s *AOGEnvironment) SetSlogColor()

type FlagSets

type FlagSets struct {
	Order    []string
	FlagSets map[string]*pflag.FlagSet
}

FlagSets Define a struct to hold the flag sets and their order

func NewFlagSets

func NewFlagSets() *FlagSets

NewFlagSets Initialize the FlagSets struct

func (*FlagSets) AddFlagSet

func (fs *FlagSets) AddFlagSet(name string, flagSet *pflag.FlagSet)

AddFlagSet Add a flag set to the struct and maintain the order

func (*FlagSets) GetFlagSet

func (fs *FlagSets) GetFlagSet(name string) *pflag.FlagSet

GetFlagSet Get the flag set by name, creating it if it doesn't exist

Jump to

Keyboard shortcuts

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