options

package
v0.0.0-...-06831c0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

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

func FullURL

func FullURL(pp ...string) string

will return base URL with domain and prefix path

func FullWebappURL

func FullWebappURL(pp ...string) string

func GuessApiHostname

func GuessApiHostname() string

func GuessWebappHostname

func GuessWebappHostname() string

Types

type ActionLogOpt

type ActionLogOpt struct {
	Enabled                  bool `env:"ACTIONLOG_ENABLED"`
	Debug                    bool `env:"ACTIONLOG_DEBUG"`
	WorkflowFunctionsEnabled bool `env:"ACTIONLOG_WORKFLOW_FUNCTIONS_ENABLED"`
}

func ActionLog

func ActionLog() (o *ActionLogOpt)

ActionLog initializes and returns a ActionLogOpt with default values

This function is auto-generated

type ApigwOpt

type ApigwOpt struct {
	Enabled              bool          `env:"APIGW_ENABLED"`
	Debug                bool          `env:"APIGW_DEBUG"`
	LogEnabled           bool          `env:"APIGW_LOG_ENABLED"`
	ProfilerEnabled      bool          `env:"APIGW_PROFILER_ENABLED"`
	ProfilerGlobal       bool          `env:"APIGW_PROFILER_GLOBAL"`
	LogRequestBody       bool          `env:"APIGW_LOG_REQUEST_BODY"`
	ProxyEnableDebugLog  bool          `env:"APIGW_PROXY_ENABLE_DEBUG_LOG"`
	ProxyFollowRedirects bool          `env:"APIGW_PROXY_FOLLOW_REDIRECTS"`
	ProxyOutboundTimeout time.Duration `env:"APIGW_PROXY_OUTBOUND_TIMEOUT"`
}

func Apigw

func Apigw() (o *ApigwOpt)

Apigw initializes and returns a ApigwOpt with default values

This function is auto-generated

type AttachmentOpt

type AttachmentOpt struct {
	AvatarMaxFileSize             int64  `env:"ATTACHMENT_AVATAR_MAX_FILE_SIZE"`
	AvatarInitialsFontPath        string `env:"AVATAR_INITIALS_FONT_PATH"`
	AvatarInitialsBackgroundColor string `env:"AVATAR_INITIALS_BACKGROUND_COLOR"`
	AvatarInitialsColor           string `env:"AVATAR_INITIALS_COLOR"`
}

func Attachment

func Attachment() (o *AttachmentOpt)

Attachment initializes and returns a AttachmentOpt with default values

This function is auto-generated

type AuthOpt

type AuthOpt struct {
	LogEnabled               bool          `env:"AUTH_LOG_ENABLED"`
	PasswordSecurity         bool          `env:"AUTH_PASSWORD_SECURITY"`
	JwtAlgorithm             string        `env:"AUTH_JWT_ALGORITHM"`
	Secret                   string        `env:"AUTH_JWT_SECRET"`
	JwtKey                   string        `env:"AUTH_JWT_KEY"`
	AccessTokenLifetime      time.Duration `env:"AUTH_OAUTH2_ACCESS_TOKEN_LIFETIME"`
	RefreshTokenLifetime     time.Duration `env:"AUTH_OAUTH2_REFRESH_TOKEN_LIFETIME"`
	ExternalRedirectURL      string        `env:"AUTH_EXTERNAL_REDIRECT_URL"`
	ExternalCookieSecret     string        `env:"AUTH_EXTERNAL_COOKIE_SECRET"`
	BaseURL                  string        `env:"AUTH_BASE_URL"`
	SessionCookieName        string        `env:"AUTH_SESSION_COOKIE_NAME"`
	SessionCookiePath        string        `env:"AUTH_SESSION_COOKIE_PATH"`
	SessionCookieDomain      string        `env:"AUTH_SESSION_COOKIE_DOMAIN"`
	SessionCookieSecure      bool          `env:"AUTH_SESSION_COOKIE_SECURE"`
	SessionLifetime          time.Duration `env:"AUTH_SESSION_LIFETIME"`
	SessionPermLifetime      time.Duration `env:"AUTH_SESSION_PERM_LIFETIME"`
	GarbageCollectorInterval time.Duration `env:"AUTH_GARBAGE_COLLECTOR_INTERVAL"`
	RequestRateLimit         int           `env:"AUTH_REQUEST_RATE_LIMIT"`
	RequestRateWindowLength  time.Duration `env:"AUTH_REQUEST_RATE_WINDOW_LENGTH"`
	CsrfSecret               string        `env:"AUTH_CSRF_SECRET"`
	CsrfEnabled              bool          `env:"AUTH_CSRF_ENABLED"`
	CsrfFieldName            string        `env:"AUTH_CSRF_FIELD_NAME"`
	CsrfCookieName           string        `env:"AUTH_CSRF_COOKIE_NAME"`
	DefaultClient            string        `env:"AUTH_DEFAULT_CLIENT"`
	AssetsPath               string        `env:"AUTH_ASSETS_PATH"`
	DevelopmentMode          bool          `env:"AUTH_DEVELOPMENT_MODE"`
	ProvisionSuperUser       string        `env:"AUTH_PROVISION_SUPER_USER"`
}

func Auth

func Auth() (o *AuthOpt)

Auth initializes and returns a AuthOpt with default values

This function is auto-generated

type CorredorOpt

type CorredorOpt struct {
	Enabled               bool          `env:"CORREDOR_ENABLED"`
	Addr                  string        `env:"CORREDOR_ADDR"`
	MaxBackoffDelay       time.Duration `env:"CORREDOR_MAX_BACKOFF_DELAY"`
	MaxReceiveMessageSize int           `env:"CORREDOR_MAX_RECEIVE_MESSAGE_SIZE"`
	DefaultExecTimeout    time.Duration `env:"CORREDOR_DEFAULT_EXEC_TIMEOUT"`
	ListTimeout           time.Duration `env:"CORREDOR_LIST_TIMEOUT"`
	ListRefresh           time.Duration `env:"CORREDOR_LIST_REFRESH"`
	RunAsEnabled          bool          `env:"CORREDOR_RUN_AS_ENABLED"`
	TlsCertEnabled        bool          `env:"CORREDOR_CLIENT_CERTIFICATES_ENABLED"`
	TlsCertPath           string        `env:"CORREDOR_CLIENT_CERTIFICATES_PATH"`
	TlsCertCA             string        `env:"CORREDOR_CLIENT_CERTIFICATES_CA"`
	TlsCertPrivate        string        `env:"CORREDOR_CLIENT_CERTIFICATES_PRIVATE"`
	TlsCertPublic         string        `env:"CORREDOR_CLIENT_CERTIFICATES_PUBLIC"`
	TlsServerName         string        `env:"CORREDOR_CLIENT_CERTIFICATES_SERVER_NAME"`
}

func Corredor

func Corredor() (o *CorredorOpt)

Corredor initializes and returns a CorredorOpt with default values

This function is auto-generated

func (*CorredorOpt) Cleanup

func (o *CorredorOpt) Cleanup()

type DBOpt

type DBOpt struct {
	DSN string `env:"DB_DSN"`
}

func DB

func DB() (o *DBOpt)

DB initializes and returns a DBOpt with default values

This function is auto-generated

func (*DBOpt) Cleanup

func (o *DBOpt) Cleanup()

func (DBOpt) IsSQLite

func (o DBOpt) IsSQLite() bool

type DiscoveryOpt

type DiscoveryOpt struct {
	Enabled       bool   `env:"DISCOVERY_ENABLED"`
	Debug         bool   `env:"DISCOVERY_DEBUG"`
	CortezaDomain string `env:"DISCOVERY_CORTEZA_DOMAIN"`
	BaseUrl       string `env:"DISCOVERY_BASE_URL"`
}

func Discovery

func Discovery() (o *DiscoveryOpt)

Discovery initializes and returns a DiscoveryOpt with default values

This function is auto-generated

type EnvironmentOpt

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

func Environment

func Environment() (o *EnvironmentOpt)

Environment initializes and returns a EnvironmentOpt with default values

This function is auto-generated

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 EventbusOpt

type EventbusOpt struct {
	SchedulerEnabled  bool          `env:"EVENTBUS_SCHEDULER_ENABLED"`
	SchedulerInterval time.Duration `env:"EVENTBUS_SCHEDULER_INTERVAL"`
}

func Eventbus

func Eventbus() (o *EventbusOpt)

Eventbus initializes and returns a EventbusOpt with default values

This function is auto-generated

type FederationOpt

type FederationOpt struct {
	Enabled                  bool          `env:"FEDERATION_ENABLED"`
	Label                    string        `env:"FEDERATION_LABEL"`
	Host                     string        `env:"FEDERATION_HOST"`
	StructureMonitorInterval time.Duration `env:"FEDERATION_SYNC_STRUCTURE_MONITOR_INTERVAL"`
	StructurePageSize        int           `env:"FEDERATION_SYNC_STRUCTURE_PAGE_SIZE"`
	DataMonitorInterval      time.Duration `env:"FEDERATION_SYNC_DATA_MONITOR_INTERVAL"`
	DataPageSize             int           `env:"FEDERATION_SYNC_DATA_PAGE_SIZE"`
}

func Federation

func Federation() (o *FederationOpt)

Federation initializes and returns a FederationOpt with default values

This function is auto-generated

type HTTPClientOpt

type HTTPClientOpt struct {
	TlsInsecure bool          `env:"HTTP_CLIENT_TLS_INSECURE"`
	Timeout     time.Duration `env:"HTTP_CLIENT_TIMEOUT"`
}

func HTTPClient

func HTTPClient() (o *HTTPClientOpt)

HTTPClient initializes and returns a HTTPClientOpt with default values

This function is auto-generated

func (*HTTPClientOpt) Defaults

func (o *HTTPClientOpt) Defaults()

type HttpServerOpt

type HttpServerOpt struct {
	Domain                 string `env:"DOMAIN"`
	DomainWebapp           string `env:"DOMAIN_WEBAPP"`
	Addr                   string `env:"HTTP_ADDR"`
	LogRequest             bool   `env:"HTTP_LOG_REQUEST"`
	LogResponse            bool   `env:"HTTP_LOG_RESPONSE"`
	Tracing                bool   `env:"HTTP_ERROR_TRACING"`
	EnableHealthcheckRoute bool   `env:"HTTP_ENABLE_HEALTHCHECK_ROUTE"`
	EnableVersionRoute     bool   `env:"HTTP_ENABLE_VERSION_ROUTE"`
	EnableDebugRoute       bool   `env:"HTTP_ENABLE_DEBUG_ROUTE"`
	EnableMetrics          bool   `env:"HTTP_METRICS"`
	MetricsServiceLabel    string `env:"HTTP_METRICS_NAME"`
	MetricsUsername        string `env:"HTTP_METRICS_USERNAME"`
	MetricsPassword        string `env:"HTTP_METRICS_PASSWORD"`
	EnablePanicReporting   bool   `env:"HTTP_REPORT_PANIC"`
	BaseUrl                string `env:"HTTP_BASE_URL"`
	ApiEnabled             bool   `env:"HTTP_API_ENABLED"`
	ApiBaseUrl             string `env:"HTTP_API_BASE_URL"`
	WebappEnabled          bool   `env:"HTTP_WEBAPP_ENABLED"`
	WebappBaseUrl          string `env:"HTTP_WEBAPP_BASE_URL"`
	WebappBaseDir          string `env:"HTTP_WEBAPP_BASE_DIR"`
	WebappList             string `env:"HTTP_WEBAPP_LIST"`
	SslTerminated          bool   `env:"HTTP_SSL_TERMINATED"`
	AssetsPath             string `env:"HTTP_SERVER_ASSETS_PATH"`
	WebConsoleEnabled      bool   `env:"HTTP_SERVER_WEB_CONSOLE_ENABLED"`
	WebConsoleUsername     string `env:"HTTP_SERVER_WEB_CONSOLE_USERNAME"`
	WebConsolePassword     string `env:"HTTP_SERVER_WEB_CONSOLE_PASSWORD"`
}

func HttpServer

func HttpServer() (o *HttpServerOpt)

HttpServer initializes and returns a HttpServerOpt with default values

This function is auto-generated

func (*HttpServerOpt) Cleanup

func (o *HttpServerOpt) Cleanup()

func (*HttpServerOpt) Defaults

func (o *HttpServerOpt) Defaults()

type LimitOpt

type LimitOpt struct {
	SystemUsers             int `env:"LIMIT_SYSTEM_USERS"`
	RecordCountPerNamespace int `env:"LIMIT_RECORD_COUNT_PER_NAMESPACE"`
}

func Limit

func Limit() (o *LimitOpt)

Limit initializes and returns a LimitOpt with default values

This function is auto-generated

type LocaleOpt

type LocaleOpt struct {
	Languages                   string `env:"LOCALE_LANGUAGES"`
	Path                        string `env:"LOCALE_PATH"`
	QueryStringParam            string `env:"LOCALE_QUERY_STRING_PARAM"`
	ResourceTranslationsEnabled bool   `env:"LOCALE_RESOURCE_TRANSLATIONS_ENABLED"`
	Log                         bool   `env:"LOCALE_LOG"`
	DevelopmentMode             bool   `env:"LOCALE_DEVELOPMENT_MODE"`
}

func Locale

func Locale() (o *LocaleOpt)

Locale initializes and returns a LocaleOpt with default values

This function is auto-generated

func (*LocaleOpt) Defaults

func (o *LocaleOpt) Defaults()

type LogOpt

type LogOpt struct {
	Debug           bool   `env:"LOG_DEBUG"`
	Level           string `env:"LOG_LEVEL"`
	Filter          string `env:"LOG_FILTER"`
	IncludeCaller   bool   `env:"LOG_INCLUDE_CALLER"`
	StacktraceLevel string `env:"LOG_STACKTRACE_LEVEL"`
}

func Log

func Log() (o *LogOpt)

Log initializes and returns a LogOpt with default values

This function is auto-generated

type MessagebusOpt

type MessagebusOpt struct {
	Enabled    bool `env:"MESSAGEBUS_ENABLED"`
	LogEnabled bool `env:"MESSAGEBUS_LOG_ENABLED"`
}

func Messagebus

func Messagebus() (o *MessagebusOpt)

Messagebus initializes and returns a MessagebusOpt with default values

This function is auto-generated

type MonitorOpt

type MonitorOpt struct {
	Interval time.Duration `env:"MONITOR_INTERVAL"`
}

func Monitor

func Monitor() (o *MonitorOpt)

Monitor initializes and returns a MonitorOpt with default values

This function is auto-generated

type ObjectStoreOpt

type ObjectStoreOpt struct {
	Path            string `env:"STORAGE_PATH"`
	MinioEndpoint   string `env:"MINIO_ENDPOINT"`
	MinioSecure     bool   `env:"MINIO_SECURE"`
	MinioAccessKey  string `env:"MINIO_ACCESS_KEY"`
	MinioSecretKey  string `env:"MINIO_SECRET_KEY"`
	MinioSSECKey    string `env:"MINIO_SSEC_KEY"`
	MinioBucket     string `env:"MINIO_BUCKET"`
	MinioPathPrefix string `env:"MINIO_PATH_PREFIX"`
	MinioStrict     bool   `env:"MINIO_STRICT"`
}

func ObjectStore

func ObjectStore() (o *ObjectStoreOpt)

ObjectStore initializes and returns a ObjectStoreOpt with default values

This function is auto-generated

type Options

type Options struct {
	Environment EnvironmentOpt
	ActionLog   ActionLogOpt
	SMTP        SMTPOpt
	Auth        AuthOpt
	HTTPClient  HTTPClientOpt
	DB          DBOpt
	Template    TemplateOpt
	Upgrade     UpgradeOpt
	Provision   ProvisionOpt
	Sentry      SentryOpt
	ObjStore    ObjectStoreOpt
	Corredor    CorredorOpt
	Monitor     MonitorOpt
	WaitFor     WaitForOpt
	HTTPServer  HttpServerOpt
	Websocket   WebsocketOpt
	Eventbus    EventbusOpt
	Messagebus  MessagebusOpt
	Federation  FederationOpt
	SCIM        SCIMOpt
	Workflow    WorkflowOpt
	RBAC        RbacOpt
	Locale      LocaleOpt
	Limit       LimitOpt
	Discovery   DiscoveryOpt
	Apigw       ApigwOpt
	Attachment  AttachmentOpt
	Webapp      WebappOpt
}

func Init

func Init() *Options

type ProvisionOpt

type ProvisionOpt struct {
	Always bool   `env:"PROVISION_ALWAYS"`
	Path   string `env:"PROVISION_PATH"`
}

func Provision

func Provision() (o *ProvisionOpt)

Provision initializes and returns a ProvisionOpt with default values

This function is auto-generated

type RbacOpt

type RbacOpt struct {
	Log                bool   `env:"RBAC_LOG"`
	ServiceUser        string `env:"RBAC_SERVICE_USER"`
	BypassRoles        string `env:"RBAC_BYPASS_ROLES"`
	AuthenticatedRoles string `env:"RBAC_AUTHENTICATED_ROLES"`
	AnonymousRoles     string `env:"RBAC_ANONYMOUS_ROLES"`
}

func Rbac

func Rbac() (o *RbacOpt)

Rbac initializes and returns a RbacOpt with default values

This function is auto-generated

type SCIMOpt

type SCIMOpt struct {
	Enabled              bool   `env:"SCIM_ENABLED"`
	BaseURL              string `env:"SCIM_BASE_URL"`
	Secret               string `env:"SCIM_SECRET"`
	ExternalIdAsPrimary  bool   `env:"SCIM_EXTERNAL_ID_AS_PRIMARY"`
	ExternalIdValidation string `env:"SCIM_EXTERNAL_ID_VALIDATION"`
}

func SCIM

func SCIM() (o *SCIMOpt)

SCIM initializes and returns a SCIMOpt with default values

This function is auto-generated

type SMTPOpt

type SMTPOpt struct {
	Host          string `env:"SMTP_HOST"`
	Port          int    `env:"SMTP_PORT"`
	User          string `env:"SMTP_USER"`
	Pass          string `env:"SMTP_PASS"`
	From          string `env:"SMTP_FROM"`
	TlsInsecure   bool   `env:"SMTP_TLS_INSECURE"`
	TlsServerName string `env:"SMTP_TLS_SERVER_NAME"`
}

func SMTP

func SMTP() (o *SMTPOpt)

SMTP initializes and returns a SMTPOpt with default values

This function is auto-generated

type SentryOpt

type SentryOpt struct {
	DSN              string  `env:"SENTRY_DSN"`
	Debug            bool    `env:"SENTRY_DEBUG"`
	AttachStacktrace bool    `env:"SENTRY_ATTACH_STACKTRACE"`
	SampleRate       float64 `env:"SENTRY_SAMPLE_RATE"`
	MaxBreadcrumbs   int     `env:"SENTRY_MAX_BREADCRUMBS"`
	ServerName       string  `env:"SENTRY_SERVERNAME"`
	Release          string  `env:"SENTRY_RELEASE"`
	Dist             string  `env:"SENTRY_DIST"`
	Environment      string  `env:"SENTRY_ENVIRONMENT"`
	WebappDSN        string  `env:"SENTRY_WEBAPP_DSN"`
}

func Sentry

func Sentry() (o *SentryOpt)

Sentry initializes and returns a SentryOpt with default values

This function is auto-generated

type TemplateOpt

type TemplateOpt struct {
	RendererGotenbergAddress string `env:"TEMPLATE_RENDERER_GOTENBERG_ADDRESS"`
	RendererGotenbergEnabled bool   `env:"TEMPLATE_RENDERER_GOTENBERG_ENABLED"`
}

func Template

func Template() (o *TemplateOpt)

Template initializes and returns a TemplateOpt with default values

This function is auto-generated

type UpgradeOpt

type UpgradeOpt struct {
	Debug  bool `env:"UPGRADE_DEBUG"`
	Always bool `env:"UPGRADE_ALWAYS"`
}

func Upgrade

func Upgrade() (o *UpgradeOpt)

Upgrade initializes and returns a UpgradeOpt with default values

This function is auto-generated

type WaitForOpt

type WaitForOpt struct {
	Delay                 time.Duration `env:"WAIT_FOR"`
	StatusPage            bool          `env:"WAIT_FOR_STATUS_PAGE"`
	Services              string        `env:"WAIT_FOR_SERVICES"`
	ServicesTimeout       time.Duration `env:"WAIT_FOR_SERVICES_TIMEOUT"`
	ServicesProbeTimeout  time.Duration `env:"WAIT_FOR_SERVICES_PROBE_TIMEOUT"`
	ServicesProbeInterval time.Duration `env:"WAIT_FOR_SERVICES_PROBE_INTERVAL"`
}

func WaitFor

func WaitFor() (o *WaitForOpt)

WaitFor initializes and returns a WaitForOpt with default values

This function is auto-generated

func (WaitForOpt) GetServices

func (o WaitForOpt) GetServices() []string

Parses hosts and return slice of strings, one per host

type WebappOpt

type WebappOpt struct {
	ScssDirPath string `env:"WEBAPP_SCSS_DIR_PATH"`
}

func Webapp

func Webapp() (o *WebappOpt)

Webapp initializes and returns a WebappOpt with default values

This function is auto-generated

type WebsocketOpt

type WebsocketOpt struct {
	LogEnabled  bool          `env:"WEBSOCKET_LOG_ENABLED"`
	Timeout     time.Duration `env:"WEBSOCKET_TIMEOUT"`
	PingTimeout time.Duration `env:"WEBSOCKET_PING_TIMEOUT"`
	PingPeriod  time.Duration `env:"WEBSOCKET_PING_PERIOD"`
}

func Websocket

func Websocket() (o *WebsocketOpt)

Websocket initializes and returns a WebsocketOpt with default values

This function is auto-generated

type WorkflowOpt

type WorkflowOpt struct {
	Register          bool `env:"WORKFLOW_REGISTER"`
	ExecDebug         bool `env:"WORKFLOW_EXEC_DEBUG"`
	CallStackSize     int  `env:"WORKFLOW_CALL_STACK_SIZE"`
	StackTraceEnabled bool `env:"WORKFLOW_STACK_TRACE_ENABLED"`
	StackTraceFull    bool `env:"WORKFLOW_STACK_TRACE_FULL"`
}

func Workflow

func Workflow() (o *WorkflowOpt)

Workflow initializes and returns a WorkflowOpt with default values

This function is auto-generated

Jump to

Keyboard shortcuts

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