config

package
v0.0.0-...-d88ec87 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientTransportProperties

type ClientTransportProperties struct {
	// MaxIdleConns see: https://golang.ir/pkg/net/http/#Transport
	// Zero means no limit.
	MaxIdleConns int `yaml:"MaxIdleConns" validate:"min=0"`
	// MaxIdleConnsPerHost see: https://golang.ir/pkg/net/http/#Transport
	// If zero, DefaultMaxIdleConnsPerHost is used.
	MaxIdleConnsPerHost int `yaml:"MaxIdleConnsPerHost" validate:"min=0"`
	// IdleConnTimeout see: https://golang.ir/pkg/net/http/#Transport
	// Zero means no limit.
	IdleConnTimeout metrics.Interval `yaml:"IdleConnTimeout"`
	// ResponseHeaderTimeout see: https://golang.ir/pkg/net/http/#Transport
	ResponseHeaderTimeout metrics.Interval `yaml:"ResponseHeaderTimeout"`
	// DisableKeepAlives see: https://golang.ir/pkg/net/http/#Transport
	// Default false
	DisableKeepAlives bool `yaml:"DisableKeepAlives"`
}

ClientTransportProperties details

type ClientTransportRules

type ClientTransportRules struct {
	Method     string `yaml:"Method" validate:"max=64"`
	Path       string `yaml:"Path" validate:"max=64"`
	QueryParam string `yaml:"QueryParam" validate:"max=64"`
}

ClientTransportRules properties

type CompiledRules

type CompiledRules struct {
	MethodRegexp     *regexp.Regexp
	PathRegexp       *regexp.Regexp
	QueryParamRegexp *regexp.Regexp
	IsCompiled       bool
}

CompiledRules properties

type TransportMatcherDefinition

type TransportMatcherDefinition struct {
	Name          string               `yaml:"Name"`
	Rules         ClientTransportRules `yaml:"Rules"`
	CompiledRules CompiledRules
	Properties    ClientTransportProperties `yaml:"Properties"`
}

TransportMatcherDefinition properties

type Transports

type Transports []TransportMatcherDefinition

Transports map with TransportMatcherDefinition

func (*Transports) GetMatchedTransportDefinition

func (t *Transports) GetMatchedTransportDefinition(method, path, queryParam string) (matchedTransport TransportMatcherDefinition, ok bool)

GetMatchedTransportDefinition returns first details matching with rules from Rules by arguments: method, path, queryParam

Jump to

Keyboard shortcuts

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