config

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log           bool   `yaml:"api_log" env:"API_LOG" env-default:"true"`
	ServerAddress string `yaml:"server_address" env-default:":3200"`
	// Discovery for SFU heartbeats
	EtcdEndpoints []string `yaml:"etcd_endpoints" env:"ETCD_ENDPOINTS" env-separator:","`
	EtcdPrefix    string   `yaml:"etcd_prefix" env:"ETCD_PREFIX" env-default:"/gochat/sfu"`
	EtcdUsername  string   `yaml:"etcd_username" env:"ETCD_USERNAME"`
	EtcdPassword  string   `yaml:"etcd_password" env:"ETCD_PASSWORD"`
	// Cassandra for attachment finalization
	Cluster         []string `yaml:"cluster" env:"CLUSTER" env-separator:","`
	ClusterKeyspace string   `yaml:"cluster_keyspace" env:"CLUSTER_KEYSPACE" env-default:"gochat"`
	// JWT secret for validating webhook tokens (HS256). Tokens carry service type and id.
	JWTSecret string `yaml:"jwt_secret" env:"WEBHOOK_JWT_SECRET"`
	// Swagger
	Swagger bool `yaml:"swagger" env:"SWAGGER" env-default:"false"`
	// Cache
	KeyDB string `yaml:"keydb" env:"KEYDB" env-default:"127.0.0.1:6379"`
	// NATS
	NatsConnString string `yaml:"nats_conn_string" env:"NATS_CONN_STRING" env-default:"nats://nats:4222"`
}

func LoadConfig

func LoadConfig(logger *slog.Logger) (*Config, error)

Jump to

Keyboard shortcuts

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