options

package
v0.0.0-...-2873e01 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanBase

func CleanBase(pp ...string) string

Path joins all parts with / and prefixes result (if not empty) with /

func EnvBool

func EnvBool(key string, def bool) bool

func EnvDuration

func EnvDuration(key string, def time.Duration) time.Duration

func EnvFloat32

func EnvFloat32(key string, def float32) float32

func EnvInt

func EnvInt(key string, def int) int

func EnvString

func EnvString(key string, def string) string

Types

type CortezaOpt

type CortezaOpt struct {
	BaseUrl      string
	AuthUrl      string
	DiscoveryUrl string
}

func Corteza

func Corteza() (o *CortezaOpt, err error)

type EnvironmentOpt

type EnvironmentOpt struct {
	Environment string `env:"ENVIRONMENT"`
}

func Environment

func Environment() (o *EnvironmentOpt)

Environment initializes and returns a EnvironmentOpt with default values

func (EnvironmentOpt) IsDevelopment

func (e EnvironmentOpt) IsDevelopment() bool

func (EnvironmentOpt) IsProduction

func (e EnvironmentOpt) IsProduction() bool

func (EnvironmentOpt) IsTest

func (e EnvironmentOpt) IsTest() bool

type EsOpt

type EsOpt struct {
	Addresses            []string `env:"ES_ADDRESS"`
	Username             string   `env:"ES_USERNAME"`
	Password             string   `env:"ES_PASSWORD"`
	Secure               bool     `env:"ES_SECURE"`
	EnableRetryOnTimeout bool     `env:"ES_ENABLE_RETRY_ON_TIMEOUT"`
	MaxRetries           int      `env:"ES_MAX_RETRIES"`
	IndexInterval        int      `env:"ES_INDEX_INTERVAL"`
}

func ES

func ES() (o *EsOpt, err error)

type HttpServerOpt

type HttpServerOpt struct {
	Addr                   string `env:"HTTP_ADDR"`
	EnableHealthcheckRoute bool   `env:"HTTP_ENABLE_HEALTHCHECK_ROUTE"`
	EnableVersionRoute     bool   `env:"HTTP_ENABLE_VERSION_ROUTE"`
	BaseUrl                string `env:"HTTP_BASE_URL"`
	ApiBaseUrl             string `env:"HTTP_API_BASE_URL"`
}

func HttpServer

func HttpServer() (o *HttpServerOpt)

HttpServer initializes and returns a HTTPServerOpt with default values

type IndexerOpt

type IndexerOpt struct {
	Enabled bool
	//HttpAddr             string
	CortezaServerBaseUrl string
	CortezaServerAuthUrl string
	CortezaDiscoveryAPI  string

	Schemas []*schema
}

func Indexer

func Indexer() (o *IndexerOpt, err error)

type Options

type Options struct {
	Corteza     CortezaOpt
	ES          EsOpt
	Indexer     IndexerOpt
	Searcher    SearcherOpt
	Environment EnvironmentOpt
	HTTPServer  HttpServerOpt
	WaitFor     WaitForOpt
}

func Init

func Init() (opt *Options, err error)

type SearcherOpt

type SearcherOpt struct {
	Enabled bool
	//HttpAddr     string
	JwtSecret    []byte
	ClientKey    string
	ClientSecret string

	// temp fix: remove it once allowed role is fixed on server
	AllowedRole map[interface{}]bool
}

func Searcher

func Searcher() (*SearcherOpt, error)

type WaitForOpt

type WaitForOpt struct {
	Delay      time.Duration `env:"WAIT_FOR"`
	StatusPage bool          `env:"WAIT_FOR_STATUS_PAGE"`
}

func WaitFor

func WaitFor() (o *WaitForOpt)

WaitFor initializes and returns a WaitForOpt with default values

Jump to

Keyboard shortcuts

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