config

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Init

func Init()

func IsProduction

func IsProduction() bool

Types

type CacheMode

type CacheMode string

CacheMode has the following constants: CacheModeMemory, CacheModeRedis

const (
	CacheModeMemory CacheMode = "memory"
	CacheModeRedis  CacheMode = "redis"
)

type Config

type Config struct {
	Server   ServerConfig
	Frontend struct {
		ExternalUrl string
	}
	Database             DatabaseConfig
	InitialVirtualServer struct {
		Name                  string
		DisplayName           string
		EnableRegistration    bool
		SigningAlgorithm      SigningAlgorithm
		CreateSystemAdminRole bool
		CreateAdmin           bool
		Admin                 struct {
			Username     string
			DisplayName  string
			PrimaryEmail string
			PasswordHash string
			Roles        []string
		}
		ServiceUsers []struct {
			Username  string
			Roles     []string
			PublicKey struct {
				Pem string
				Kid string
			}
		}
		Projects []InitialProjectConfig
		Mail     struct {
			Host     string
			Port     int
			Username string
			Password string
		}
	}
	KeyStore KeyStoreConfig
	Cache    struct {
		Mode  CacheMode
		Redis struct {
			Host     string
			Port     int
			Username string
			Password string
			Database int
		}
	}
	LeaderElection LeaderElectionConfig
}
var C Config

type DatabaseConfig

type DatabaseConfig struct {
	Mode     DatabaseMode
	Postgres PostgresConfig
	Sqlite   struct {
		Database string
	}
}

type DatabaseMode

type DatabaseMode string

DatabaseMode has the following constants: DatabaseModePostgres, DatabaseModeSqlite

const (
	DatabaseModePostgres DatabaseMode = "postgres"
	DatabaseModeSqlite   DatabaseMode = "sqlite"
	DatabaseModeMemory   DatabaseMode = "memory"
)

type InitialProjectConfig

type InitialProjectConfig struct {
	Slug        string
	Name        string
	Description string
	Roles       []struct {
		Name        string
		Description string
	}
	Applications []struct {
		Name                   string
		DisplayName            string
		Type                   string
		HashedSecret           *string
		RedirectUris           []string
		PostLogoutRedirectUris []string
		DeviceFlowEnabled      bool
	}
	ResourceServers []struct {
		Slug        string
		Name        string
		Description string
	}
}

type KeyStoreConfig

type KeyStoreConfig struct {
	Mode      KeyStoreMode
	Vault     VaultKeyStoreConfig
	Directory struct {
		Path string
	}
}

type KeyStoreMode

type KeyStoreMode string

KeyStoreMode has the following constants: KeyStoreModeMemory (testing only), KeyStoreModeDirectory, KeyStoreModeOpenBao

const (
	KeyStoreModeMemory    KeyStoreMode = "memory"
	KeyStoreModeDirectory KeyStoreMode = "directory"
	KeyStoreModeVault     KeyStoreMode = "vault"
)

type LeaderElectionConfig

type LeaderElectionConfig struct {
	Mode LeaderElectionMode
	Raft LeaderElectionRaftConfig
}

type LeaderElectionMode

type LeaderElectionMode string
const (
	LeaderElectionModeNone LeaderElectionMode = "none"
	LeaderElectionModeRaft LeaderElectionMode = "raft"
)

type LeaderElectionRaftConfig

type LeaderElectionRaftConfig struct {
	Host        string
	Port        int
	Id          string
	InitiatorId string
	Nodes       []RaftNode
}

type PostgresConfig

type PostgresConfig struct {
	Database string
	Host     string
	Port     int
	Username string
	Password string
	SslMode  string
}

type QueueMode

type QueueMode string

QueueMode has the following constants: DeliveryModeNoop, DeliveryModeInProcess

const (
	QueueModeNoop      QueueMode = "noop"
	QueueModeInProcess QueueMode = "in-process"
)

type RaftNode

type RaftNode struct {
	Id      string
	Address string
}

type ServerConfig

type ServerConfig struct {
	ExternalUrl    string
	ExternalDomain string
	Host           string
	Port           int
	ApiPort        int
	AllowedOrigins []string
}

type SigningAlgorithm

type SigningAlgorithm string
const (
	SigningAlgorithmRS256 SigningAlgorithm = "RS256"
	SigningAlgorithmEdDSA SigningAlgorithm = "EdDSA"
)

type VaultKeyStoreConfig

type VaultKeyStoreConfig struct {
	Address string
	Token   string
	Mount   string
	Prefix  string
}

Jump to

Keyboard shortcuts

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