config

package
v0.1.60 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 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" json:"key" yaml:"key"`
	BaseURL      string `mapstructure:"base_url" json:"base_url" yaml:"base_url"`
	RequireScope bool   `mapstructure:"require_scope" json:"require_scope" yaml:"require_scope"`
}

type APIs

type APIs struct {
	Version  toolx.CamundaVersion `mapstructure:"version" json:"version" yaml:"version"`
	Camunda  API                  `mapstructure:"camunda_api" json:"camunda_api" yaml:"camunda_api"`
	Operate  API                  `mapstructure:"operate_api" json:"operate_api" yaml:"operate_api"`
	Tasklist API                  `mapstructure:"tasklist_api" json:"tasklist_api" yaml:"tasklist_api"`
}

func (*APIs) Normalize

func (a *APIs) Normalize() error

func (*APIs) Validate

func (a *APIs) Validate(scopes Scopes) error

type App

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

func (*App) ViewTenant

func (a *App) ViewTenant() string

type Auth

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

func (*Auth) Validate

func (c *Auth) Validate() error

type AuthCookieSession

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

func (*AuthCookieSession) Validate

func (c *AuthCookieSession) Validate() error

type AuthMode

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

func (AuthMode) IsValid

func (m AuthMode) IsValid() bool

type AuthOAuth2ClientCredentials

type AuthOAuth2ClientCredentials struct {
	TokenURL     string `mapstructure:"token_url" json:"token_url" yaml:"token_url"`
	ClientID     string `mapstructure:"client_id" json:"client_id" yaml:"client_id"`
	ClientSecret string `mapstructure:"client_secret" json:"client_secret" yaml:"client_secret"`
	Scopes       Scopes `mapstructure:"scopes" json:"scopes" yaml:"scopes"`
}

func (*AuthOAuth2ClientCredentials) Scope

func (*AuthOAuth2ClientCredentials) Validate

func (a *AuthOAuth2ClientCredentials) Validate() error

type Config

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

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

func FromContext

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

func (*Config) Normalize

func (c *Config) Normalize() error

func (*Config) ToContext

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

func (*Config) ToSanitizedYAML

func (c *Config) ToSanitizedYAML() (string, error)

func (*Config) ToTemplateYAML

func (c *Config) ToTemplateYAML() (string, error)

func (*Config) Validate

func (c *Config) Validate() error

type HTTP

type HTTP struct {
	Timeout string `mapstructure:"timeout" json:"timeout" yaml:"timeout"`
}

func (*HTTP) Validate

func (h *HTTP) Validate() error

type Scopes

type Scopes map[string]string

Jump to

Keyboard shortcuts

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