config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config defines the necessary types to configure the application. An example config file config.yaml is provided in the repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeConnStr

func MakeConnStr(conf Database) (string, error)

Types

type Config

type Config struct {
	commoncfg.BaseConfig `mapstructure:",squash" yaml:",inline"`

	HTTP HTTPServer `yaml:"http"`
	GRPC GRPCServer `yaml:"grpc"`

	Database       Database       `yaml:"database"`
	ValKey         ValKey         `yaml:"valkey"`
	Migrate        Migrate        `yaml:"migrate"`
	SessionManager SessionManager `yaml:"sessionManager"`
	TokenRefresher TokenRefresher `yaml:"tokenRefresher"`
}

type Database

type Database struct {
	Name     string              `yaml:"name"`
	Port     string              `yaml:"port"`
	Host     commoncfg.SourceRef `yaml:"host"`
	User     commoncfg.SourceRef `yaml:"user"`
	Password commoncfg.SourceRef `yaml:"password"`
}

type GRPCServer

type GRPCServer struct {
	commoncfg.GRPCServer `mapstructure:",squash" yaml:",inline"`

	ShutdownTimeout time.Duration `yaml:"shutdownTimeout" default:"5s"`
}

type HTTPServer

type HTTPServer struct {
	Address         string        `yaml:"address" default:":8080"`
	ShutdownTimeout time.Duration `yaml:"shutdownTimeout" default:"5s"`
}

type Migrate

type Migrate struct {
	Source string `yaml:"source" default:"file://./sql"`
}

type SessionManager

type SessionManager struct {
	SessionDuration time.Duration       `yaml:"sessionDuration" default:"12h"`
	RedirectURI     string              `yaml:"redirectURI" default:"https://api.cmk/callback"`
	ClientID        commoncfg.SourceRef `yaml:"clientID"`
	CSRFSecret      commoncfg.SourceRef `yaml:"csrfSecret"`
	JWSSigAlgs      []string            `yaml:"jwsSigAlgs"` // A list of supported JWT signature algorithms
}

type TokenRefresher added in v0.1.0

type TokenRefresher struct {
	RefreshInterval time.Duration `yaml:"refreshInterval" default:"30m"`
}

type ValKey

type ValKey struct {
	Host     commoncfg.SourceRef `yaml:"host"`
	User     commoncfg.SourceRef `yaml:"user"`
	Password commoncfg.SourceRef `yaml:"password"`
	Prefix   string              `yaml:"prefix"`
}

Jump to

Keyboard shortcuts

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