libapp

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 26 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(c *conf.Consul) (registry.Discovery, error)

func NewLeakyBucketMiddleware added in v0.2.1

func NewLeakyBucketMiddleware(rate int) middleware.Middleware

func NewNodeFilter added in v0.1.0

func NewNodeFilter() selector.NodeFilter

func NewRegistrar added in v0.1.0

func NewRegistrar(c *conf.Consul) (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 (
	EnvCreateAdminUserName Env = "CREATE_ADMIN_USER"
	EnvCreateAdminPassword Env = "CREATE_ADMIN_PASS"
	EnvLogLevel            Env = "LOG_LEVEL"
	EnvDemoMode            Env = "DEMO_MODE"
	EnvAllowRegister       Env = "ALLOW_REGISTER"
	EnvUserCapacity        Env = "USER_CAPACITY"
)

type Flags added in v0.0.10

type Flags struct {
	ConfPath string
	DataPath string
}

type HealthChecker added in v0.2.0

type HealthChecker struct {
	// contains filtered or unexported fields
}

func NewHealthChecker added in v0.2.0

func NewHealthChecker(serviceName string, c *conf.Consul) (*HealthChecker, error)

func (*HealthChecker) GetAliveInstances added in v0.2.0

func (hc *HealthChecker) GetAliveInstances() ([]*api.ServiceEntry, error)

type InherentSettings added in v0.0.10

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

type Settings added in v0.0.10

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

func NewAppSettings added in v0.0.10

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

func (*Settings) Env added in v0.2.2

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

func (*Settings) EnvExist added in v0.2.2

func (a *Settings) EnvExist(env Env) bool

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