config

package
v0.0.0-...-1a3a2fa Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Defaults

func Defaults(keyTag, defaultTag string) mapstructure.DecodeHookFunc

Types

type Alerting

type Alerting struct {
	Enable              bool                `yaml:"enable" form:"enable"`
	LookbackDays        uint                `yaml:"lookbackDays" form:"lookbackDays"`
	HalfLife            jsontypes.Duration  `yaml:"halfLife" form:"halfLife"`
	Recent              jsontypes.Duration  `yaml:"recent" form:"recent"`
	AlertThreshold      float64             `yaml:"alertThreshold" form:"alertThreshold"`
	Renotify            *jsontypes.Duration `yaml:"renotify,omitempty" form:"renotify,omitempty"`
	Transcripts         uint                `yaml:"transcripts" form:"transcripts"`
	MaxContext          uint                `yaml:"maxContext" form:"maxContext"`
	CallLengthThreshold jsontypes.Duration  `yaml:"callLengthThreshold" form:"callLengthThreshold" default:"4s"`
	ContextLookback     jsontypes.Duration  `yaml:"contextLookback" form:"contextLookback" default:"10m"`
	PruneIntervalDays   uint                `yaml:"pruneIntervalDays" form:"pruneIntervalDays"`
}

type Auth

type Auth struct {
	JWTSecret                string          `yaml:"jwtsecret"`
	AllowInsecure            map[string]bool `yaml:"allowInsecureFor"`
	SameSiteNoneWhenInsecure bool            `yaml:"sameSiteNoneForInsecure"`
	APIKeyACL                *acl.IPConfig   `yaml:"apiKeyACL"`
	AccessExpiry             *time.Duration  `yaml:"accessExpiry"`
	RefreshExpiry            *time.Duration  `yaml:"refreshExpiry"`
}

type CORS

type CORS struct {
	AllowedOrigins []string `yaml:"allowedOrigins"`
}

type CallStorage

type CallStorage struct {
	OnExhaust    *StorageDisposition    `yaml:"onExhaust"`
	DisablePrune bool                   `yaml:"disablePrune"`
	Backends     []StorageBackendConfig `yaml:"backends"`
}

type Config

type Config struct {
	Server        Server         `yaml:"server"`
	DB            DB             `yaml:"db"`
	Auth          Auth           `yaml:"auth"`
	Alerting      Alerting       `yaml:"alerting"`
	Ingest        []IngestFilter `yaml:"ingest"`
	Log           []Logger       `yaml:"log"`
	Notify        Notify         `yaml:"notify"`
	CallStorage   CallStorage    `yaml:"callStorage"`
	Relay         []Relay        `yaml:"relay"`
	Transcription Workers        `yaml:"transcription"`
	Metrics       Metrics        `yaml:"metrics"`
}

type ConfigMap

type ConfigMap map[string]any

type Configuration

type Configuration struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(configFile *string) *Configuration

New creates a new Configuration, but does not read it. configFile is a pointer so that it may be mutated by koanf options.

func (*Configuration) Before

func (c *Configuration) Before(ctx context.Context, cmd *cli.Command) (context.Context, error)

func (*Configuration) ReadConfig

func (c *Configuration) ReadConfig() error

type DB

type DB struct {
	Connect    string    `yaml:"connect"`
	LogQueries bool      `yaml:"logQueries"`
	Partition  Partition `yaml:"partition"`
}

type IngestFilter

type IngestFilter struct {
	Match       ConfigMap     `yaml:"match"`
	MinDuration time.Duration `yaml:"minDuration"`
}

type Logger

type Logger struct {
	File  *string `yaml:"file"`
	Level *string `yaml:"level"`
}

type Metrics

type Metrics struct {
	Enabled  bool          `yaml:"enabled"`
	Path     string        `yaml:"path"`
	Username string        `yaml:"username"`
	Password string        `yaml:"password"`
	ACL      *acl.IPConfig `yaml:"acl"`
}

type Notify

type Notify struct {
	SubjectTemplate *string         `yaml:"subjectTemplate" json:"subjectTemplate"`
	BodyTemplate    *string         `yaml:"bodyTemplate" json:"bodyTemplate"`
	Backends        []NotifyService `yaml:"backends" json:"backends"`
}

type NotifyService

type NotifyService struct {
	Provider string    `yaml:"provider" json:"provider"`
	Config   ConfigMap `yaml:"config" json:"config"`
}

type Partition

type Partition struct {
	Enabled      bool   `yaml:"enabled"`
	Schema       string `yaml:"schema"`
	Interval     string `yaml:"interval"`
	Retain       int    `yaml:"retain"`
	PreProvision *int   `yaml:"preProvision"`
	Drop         bool   `yaml:"drop"`
}

type RateLimit

type RateLimit struct {
	Enable   bool          `yaml:"enable" default:"true"`
	Requests int           `yaml:"requests" default:"200"`
	Over     time.Duration `yaml:"over" default:"2m"`
	// contains filtered or unexported fields
}

func (*RateLimit) Verify

func (rl *RateLimit) Verify() bool

type Relay

type Relay struct {
	URL      string `yaml:"url"`
	APIKey   string `yaml:"apiKey"`
	Required bool   `yaml:"required"`
}

type Server

type Server struct {
	BaseURL     jsontypes.URL `yaml:"baseURL"`
	DumpRoutes  bool          `yaml:"dumpRoutes"`
	UseXRealIP  bool          `yaml:"useXRealIP"`
	Listen      string        `yaml:"listen" default:":3051"`
	Public      bool          `yaml:"public"`
	RateLimit   RateLimit     `yaml:"rateLimit"`
	CORS        CORS          `yaml:"cors"`
	AdminSocket *string       `yaml:"adminSocket"`
	ProfileACL  *acl.IPConfig `yaml:"profileACL"`
}

type StorageBackendConfig

type StorageBackendConfig struct {
	Name         string             `yaml:"name"`
	Ingest       bool               `yaml:"ingest"`
	Backend      string             `yaml:"backend"`
	Filter       ConfigMap          `yaml:"filter"`
	Config       ConfigMap          `yaml:"config"`
	OnError      StorageDisposition `yaml:"onError"`
	DisablePrune bool               `yaml:"disablePrune"`
}

type StorageDisposition

type StorageDisposition int
const (
	OnErrorNext StorageDisposition = iota
	OnErrorFail
	OnErrorDB
)

func (*StorageDisposition) UnmarshalText

func (sd *StorageDisposition) UnmarshalText(s []byte) error

type Workers

type Workers struct {
	Filter         ConfigMap `yaml:"filter,omitempty"`
	AtLeastSeconds int       `yaml:"atLeastSeconds"`
}

Jump to

Keyboard shortcuts

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