config

package
v0.0.0-...-d46a54d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConf

type APIConf struct {
	Enabled             bool                 `mapstructure:"enabled"`
	Address             string               `mapstructure:"address"`
	ContextPath         string               `mapstructure:"context_path"`
	AssetsDirectory     string               `mapstructure:"assets_directory"`
	TLS                 common.ServerTLSConf `mapstructure:"tls"`
	ReadTimeoutSeconds  int                  `mapstructure:"read_timeout_seconds"`
	WriteTimeoutSeconds int                  `mapstructure:"write_timeout_seconds"`
	Debug               bool                 `mapstructure:"is_debug"`
	DebugPath           string               `mapstructure:"debug_path"`
}

APIConf describes API server configuration that application starts

type ProxyConf

type ProxyConf struct {
	ServerConf  ServerConf        `mapstructure:"server"`
	APIConf     APIConf           `mapstructure:"api"`
	StorageConf ServerStorageConf `mapstructure:"storage"`
	RoutesConf  RoutesConf        `mapstructure:"routes"`
}

ProxyConf is root config structure for proxy

type ProxyServerConf

type ProxyServerConf struct {
	Address   string         `mapstructure:"address"`
	TLS       common.TLSConf `mapstructure:"tls"`
	Name      string         `mapstructure:"name"`
	IsDefault bool           `mapstructure:"is_default"`
	// should rule be changeable in API (defaults to true)
	IsReadOnly *bool `mapstructure:"read_only"`
}

ProxyServerConf is proxy server configurations where request can be proxied

type ProxyServerConfigs

type ProxyServerConfigs []ProxyServerConf

ProxyServerConfigs is collections type for ProxyServerConf structure

type ReplacementConf

type ReplacementConf struct {
	Regex string `mapstructure:"regex"`
	Value string `mapstructure:"value"`
}

ReplacementConf describes rules for replacing things in request/response

type ReplacementConfigs

type ReplacementConfigs []ReplacementConf

ReplacementConfigs is collection type for ReplacementConf structures

type RoutesConf

type RoutesConf struct {
	Servers ProxyServerConfigs `mapstructure:"servers"`
	Rules   RuleConfigs        `mapstructure:"rules"`
}

RoutesConf describes configuration for x-road proxy. Contains settings for all servers and rules how to route/proxy requests

type RuleConf

type RuleConf struct {
	// server name where to direct matched request. Must have matching value in ProxyServerConfigs.Name
	Server string `mapstructure:"server"`
	// full service name to match (subsystemCode.serviceCode.serviceVersion) (for example: rr.RR67_muutus.v1)
	Service string `mapstructure:"service"`
	// priority defines in which order rules are matched. higher the better/sooner is rule matched
	Priority int64 `mapstructure:"priority"`
	// additional list of request remote addresses to decide if request is proxied to this service proxy
	MatcherRemoteAddr []string `mapstructure:"request_matcher_remote_addr"`
	// additional regex'es run on request to decide if request is proxied to this service proxy
	MatcherRegex []string `mapstructure:"request_matcher_regexes"`
	// regex'es to replace contents of request before it is proxied
	RequestReplacements ReplacementConfigs `mapstructure:"request_replacements"`
	// regex'es to replace contents of proxied response
	ResponseReplacements ReplacementConfigs `mapstructure:"response_replacements"`
	// should rule be changeable in API (defaults to true)
	IsReadOnly *bool `mapstructure:"read_only"`
}

RuleConf describes configuration for rules where and when to proxy requests

type RuleConfigs

type RuleConfigs []RuleConf

RuleConfigs is collection type for RuleConf structure

type ServerConf

type ServerConf struct {
	Enabled             bool                 `mapstructure:"enabled"`
	Address             string               `mapstructure:"address"`
	ContextPath         string               `mapstructure:"context_path"`
	TLS                 common.ServerTLSConf `mapstructure:"tls"`
	ReadTimeoutSeconds  int                  `mapstructure:"read_timeout_seconds"`
	WriteTimeoutSeconds int                  `mapstructure:"write_timeout_seconds"`
	Debug               bool                 `mapstructure:"is_debug"`
}

ServerConf describes server configuration that application starts

type ServerStorageConf

type ServerStorageConf struct {
	Requests StorageConf `mapstructure:"requests"`
	Rules    StorageConf `mapstructure:"rules"`
}

ServerStorageConf describes serve different storage configurations

type StorageConf

type StorageConf struct {
	Size       int           `mapstructure:"size"`
	Expiration time.Duration `mapstructure:"expiration"`
}

StorageConf describes storage configuration

Jump to

Keyboard shortcuts

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