config

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CamundaApiKeyConst  = "camunda_api"
	OperateApiKeyConst  = "operate_api"
	TasklistApiKeyConst = "tasklist_api"
)

Variables

View Source
var (
	ErrNoBaseURL      = errors.New("no base_url provided in api configuration")
	ErrNoTokenURL     = errors.New("no token_url provided in auth configuration")
	ErrNoClientID     = errors.New("no client_id provided in auth configuration")
	ErrNoClientSecret = errors.New("no client_secret provided in auth configuration")

	ErrNoConfigInContext       = errors.New("no config in context")
	ErrInvalidServiceInContext = errors.New("invalid config in context")
)

Functions

This section is empty.

Types

type API

type API struct {
	Key     string `mapstructure:"key"`
	BaseURL string `mapstructure:"base_url"`
}

func (*API) Validate added in v0.0.2

func (a *API) Validate() error

type APIs added in v0.0.6

type APIs struct {
	Version  camunda.APIVersion `mapstructure:"version"`
	Camunda  API                `mapstructure:"camunda_api"`
	Operate  API                `mapstructure:"operate_api"`
	Tasklist API                `mapstructure:"tasklist_api"`
}

func (*APIs) Validate added in v0.0.6

func (a *APIs) Validate() error

type App added in v0.0.9

type App struct {
	Tenant  string               `mapstructure:"tenant"`
	Backoff common.BackoffConfig `mapstructure:"backoff"`
}

type Auth added in v0.0.35

type Auth struct {
	Mode   AuthMode                    `mapstructure:"mode"`
	OAuth2 AuthOAuth2ClientCredentials `mapstructure:"oauth2"`
	Cookie AuthCookieSession           `mapstructure:"cookie"`
}

func (*Auth) Validate added in v0.0.35

func (c *Auth) Validate() error

type AuthCookieSession added in v0.0.35

type AuthCookieSession struct {
	BaseURL  string `mapstructure:"base_url"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

func (*AuthCookieSession) Validate added in v0.0.35

func (c *AuthCookieSession) Validate() error

type AuthMode added in v0.0.35

type AuthMode string
const (
	ModeOAuth2 AuthMode = "oauth2"
	ModeCookie AuthMode = "cookie"
)

func (AuthMode) IsValid added in v0.0.35

func (m AuthMode) IsValid() bool

type AuthOAuth2ClientCredentials added in v0.0.35

type AuthOAuth2ClientCredentials struct {
	TokenURL     string            `mapstructure:"token_url"`
	ClientID     string            `mapstructure:"client_id"`
	ClientSecret string            `mapstructure:"client_secret"`
	Scopes       map[string]string `mapstructure:"scopes"`
}

func (*AuthOAuth2ClientCredentials) Scope added in v0.0.35

func (*AuthOAuth2ClientCredentials) Validate added in v0.0.35

func (a *AuthOAuth2ClientCredentials) Validate() error

type Config

type Config struct {
	Config string `mapstructure:"config"`

	App  App  `mapstructure:"app"`
	Auth Auth `mapstructure:"auth"`
	APIs APIs `mapstructure:"apis"`
	HTTP HTTP `mapstructure:"http"`
}

func FromContext

func FromContext(ctx context.Context) (*Config, error)

func (*Config) String added in v0.0.6

func (c *Config) String() string

func (*Config) ToContext added in v0.0.6

func (c *Config) ToContext(ctx context.Context) context.Context

func (*Config) Validate

func (c *Config) Validate() error

Validate checks all nested sections and aggregates errors.

type HTTP

type HTTP struct {
	Timeout string `mapstructure:"timeout"` // Go duration string, e.g., "30s"
}

func (*HTTP) Validate added in v0.0.6

func (h *HTTP) Validate() error

Jump to

Keyboard shortcuts

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