config

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 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 Authentication added in v0.0.6

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

func (*Authentication) Scope added in v0.0.6

func (a *Authentication) Scope(key string) string

func (*Authentication) Validate added in v0.0.6

func (a *Authentication) Validate() error

type Config

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

	App  App            `mapstructure:"app"`
	Auth Authentication `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