Documentation
¶
Index ¶
- Constants
- func AddAuthMethod(name string, options any) (err error)
- func AddFilter(re string, replaceTo string) error
- func Check(cfg any, list []any) error
- func ConvExtra(src *any, obj any) (err error)
- func Embed(fs *embed.FS)
- func GetConfig() any
- func GetSecuredText() string
- func GetText() string
- func LoadFile(fileName string, cfg any) (err error)
- func SetCommon(cc *Common)
- func SetListener(cc *Listener)
- func StringSlice2Map(src []string, conv func(name string) string) (dst misc.BoolMap)
- type App
- type Auth
- type AuthMethod
- type Common
- type DB
- type Duration
- type Listener
- type User
Constants ¶
View Source
const ( // AuthMethodBasic -- AuthMethodBasic = "basic" // AuthMethodJWT -- AuthMethodJWT = "jwt" // AuthMethodKrb5 -- AuthMethodKrb5 = "krb5" )
View Source
const ( // ListenerDefaultTimeout -- ListenerDefaultTimeout = Duration(5 * time.Second) // ClientDefaultTimeout -- ClientDefaultTimeout = Duration(5 * time.Second) // JWTdefaultLifetimeAccess -- JWTdefaultLifetimeAccess = Duration(time.Hour) // JWTdefaultLifetimeRefresh -- JWTdefaultLifetimeRefresh = Duration(2 * 24 * time.Hour) )
Variables ¶
This section is empty.
Functions ¶
func AddAuthMethod ¶ added in v0.1.28
AddAuthMethod --
func GetSecuredText ¶ added in v0.1.8
func GetSecuredText() string
GetSecuredText -- get prepared configuration text with securing
Types ¶
type Auth ¶ added in v0.1.28
type Auth struct { EndpointsSlice map[string][]string `toml:"endpoints"` Endpoints map[string]misc.BoolMap `toml:"-"` UsersMap misc.StringMap `toml:"users"` Users map[string]User `toml:"-"` Realm string `toml:"realm"` Methods map[string]*AuthMethod `toml:"methods"` LocalAdminGroups []string `toml:"local-auth-groups"` LocalAdminGroupsMap misc.BoolMap `toml:"-"` }
Auth --
type AuthMethod ¶ added in v0.1.28
type AuthMethod struct { Enabled bool `toml:"enabled"` Score int `toml:"score"` Options any `toml:"options"` }
AuthMethod --
type Common ¶
type Common struct { Name string `toml:"name"` Description string `toml:"description"` Class string `toml:"class"` LogLocalTime bool `toml:"log-local-time"` LogDir string `toml:"log-dir"` LogLevel string `toml:"log-level"` // default LogLevels misc.StringMap `toml:"log-levels"` // by facilities LogBufferSize int `toml:"log-buffer-size"` LogBufferDelay Duration `toml:"log-buffer-delay"` LogMaxStringLen int `toml:"log-max-string-len"` GoMaxProcs int `toml:"go-max-procs"` MemStatsPeriod Duration `toml:"mem-stats-period"` MemStatsLevel string `toml:"mem-stats-level"` LoadAvgPeriod Duration `toml:"load-avg-period"` ProfilerEnabled bool `toml:"profiler-enabled"` DeepProfiling bool `toml:"deep-profiling"` UseStdJSON bool `toml:"use-std-json"` // Default values for stdhttp callers SkipTLSVerification bool `toml:"skip-tls-verification"` MinSizeForGzip int `toml:"min-size-for-gzip"` MaxWorkersCount int `toml:"max-workers-count"` }
Common --
type DB ¶
type DB struct { Type string `toml:"type"` DSN string `toml:"dsn"` MaxConnection int `toml:"max-conn"` Retry int `toml:"retry"` }
DB --
type Duration ¶ added in v0.1.44
func (Duration) MarshalText ¶ added in v0.1.44
MarshalText implements encoding.TextMarshaler
func (*Duration) UnmarshalText ¶ added in v0.1.44
UnmarshalText implements encoding.TextUnmarshaler
type Listener ¶
type Listener struct { // Addr should be set to the desired listening host:port Addr string `toml:"bind-addr"` Root string `toml:"root"` // in filesystem ProxyPrefix string `toml:"proxy-prefix"` // Set certificate in order to handle HTTPS requests SSLCombinedPem string `toml:"ssl-combined-pem"` // Timeout Duration `toml:"timeout"` IconFile string `toml:"icon-file"` DisabledEndpointsSlice []string `toml:"disabled-endpoints"` DisabledEndpoints misc.BoolMap `toml:"-"` Auth Auth `toml:"auth"` }
Listener --
Click to show internal directories.
Click to hide internal directories.