libapp

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetLogger added in v0.0.6

func GetLogger() log.Logger

func NewContext added in v0.1.0

func NewContext(ctx context.Context, requiredFeature string) context.Context

func NewDiscovery added in v0.1.0

func NewDiscovery() (registry.Discovery, error)

func NewNodeFilter added in v0.1.0

func NewNodeFilter() selector.NodeFilter

func NewRegistrar added in v0.1.0

func NewRegistrar() (registry.Registrar, error)

func NewStreamMiddlewareJwt added in v0.1.3

func NewStreamMiddlewareJwt(auth *libauth.Auth) func(ctx context.Context) (context.Context, error)

func NewValidator added in v0.1.9

func NewValidator() (middleware.Middleware, error)

Types

type Env added in v0.0.10

type Env string
const (
	EnvCreateAdmin Env = "CREATE_ADMIN"
	EnvLogLevel    Env = "LOG_LEVEL"
)

type Flags added in v0.0.10

type Flags struct {
	ConfPath string
	DataPath string
}

type InherentSettings added in v0.0.10

type InherentSettings struct {
	EnablePanicRecovery bool
	LogLevel            libzap.Level
	DefaultConfPath     string
}

type Locale added in v0.1.8

type Locale int
const (
	LocaleEn Locale = iota
	LocaleChs
	LocaleCht
)

func GetLocale added in v0.1.8

func GetLocale() Locale

type Settings added in v0.0.10

type Settings struct {
	InherentSettings
	Flags
	Version           string
	ProtoVersion      string
	BuildDate         string
	SourceCodeAddress string
	// contains filtered or unexported fields
}

func NewAppSettings added in v0.0.10

func NewAppSettings(id, name, version, protoVersion, date string) (*Settings, error)

func (*Settings) GetEnv added in v0.0.10

func (a *Settings) GetEnv(env Env) (string, error)

func (*Settings) GetEnvBool added in v0.0.10

func (a *Settings) GetEnvBool(env Env) (bool, error)

func (*Settings) LoadConfig added in v0.0.10

func (a *Settings) LoadConfig(conf interface{})

Jump to

Keyboard shortcuts

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