types

package
v1.7.35 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccessLogKeep is the keep string value.
	AccessLogKeep = "keep"
	// AccessLogDrop is the drop string value.
	AccessLogDrop = "drop"
	// AccessLogRedact is the redact string value.
	AccessLogRedact = "redact"
)
View Source
const (
	// CommonFormat is the common logging format (CLF).
	CommonFormat string = "common"
)
View Source
const OTelIngressServiceName = "ingress"

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLog

type AccessLog struct {
	FilePath      string            `` /* 151-byte string literal not displayed */
	Format        string            `` /* 146-byte string literal not displayed */
	Filters       *AccessLogFilters `` /* 162-byte string literal not displayed */
	Fields        *AccessLogFields  `description:"AccessLogFields." json:"fields,omitempty" toml:"fields,omitempty" yaml:"fields,omitempty" export:"true"`
	BufferingSize int64             `` /* 177-byte string literal not displayed */
	AddInternals  bool              `` /* 185-byte string literal not displayed */
	DualOutput    bool              `` /* 214-byte string literal not displayed */

	OTLP *OTelLog `` /* 158-byte string literal not displayed */
}

AccessLog holds the configuration settings for the access logger (middlewares/accesslog).

func (*AccessLog) SetDefaults

func (l *AccessLog) SetDefaults()

SetDefaults sets the default values.

type AccessLogFields

type AccessLogFields struct {
	DefaultMode string            `` /* 152-byte string literal not displayed */
	Names       map[string]string `description:"Override mode for fields" json:"names,omitempty" toml:"names,omitempty" yaml:"names,omitempty" export:"true"`
	Headers     *FieldHeaders     `` /* 134-byte string literal not displayed */
}

AccessLogFields holds configuration for access log fields.

func (*AccessLogFields) Keep

func (f *AccessLogFields) Keep(field string) bool

Keep check if the field need to be kept or dropped.

func (*AccessLogFields) KeepHeader

func (f *AccessLogFields) KeepHeader(header string) string

KeepHeader checks if the headers need to be kept, dropped or redacted and returns the status.

func (*AccessLogFields) SetDefaults

func (f *AccessLogFields) SetDefaults()

SetDefaults sets the default values.

type AccessLogFilters

type AccessLogFilters struct {
	StatusCodes   []string       `` /* 173-byte string literal not displayed */
	RetryAttempts bool           `` /* 171-byte string literal not displayed */
	MinDuration   types.Duration `` /* 185-byte string literal not displayed */
}

AccessLogFilters holds filters configuration.

type Datadog

type Datadog struct {
	Address              string         `description:"Datadog's address." json:"address,omitempty" toml:"address,omitempty" yaml:"address,omitempty"`
	PushInterval         types.Duration `` /* 140-byte string literal not displayed */
	AddEntryPointsLabels bool           `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool           `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool           `` /* 160-byte string literal not displayed */
	Prefix               string         `` /* 137-byte string literal not displayed */
}

Datadog contains address and metrics pushing interval configuration.

func (*Datadog) SetDefaults

func (d *Datadog) SetDefaults()

SetDefaults sets the default values.

type FieldHeaders

type FieldHeaders struct {
	DefaultMode string            `` /* 160-byte string literal not displayed */
	Names       map[string]string `description:"Override mode for headers" json:"names,omitempty" toml:"names,omitempty" yaml:"names,omitempty" export:"true"`
}

FieldHeaders holds configuration for access log headers.

type InfluxDB2

type InfluxDB2 struct {
	Address              string               `description:"InfluxDB v2 address." json:"address,omitempty" toml:"address,omitempty" yaml:"address,omitempty"`
	Token                tTypes.FileOrContent `` /* 186-byte string literal not displayed */
	PushInterval         types.Duration       `` /* 144-byte string literal not displayed */
	Org                  string               `description:"InfluxDB v2 org ID." json:"org,omitempty" toml:"org,omitempty" yaml:"org,omitempty" export:"true"`
	Bucket               string               `description:"InfluxDB v2 bucket ID." json:"bucket,omitempty" toml:"bucket,omitempty" yaml:"bucket,omitempty" export:"true"`
	AddEntryPointsLabels bool                 `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool                 `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool                 `` /* 160-byte string literal not displayed */
	AdditionalLabels     map[string]string    `` /* 178-byte string literal not displayed */
}

InfluxDB2 contains address, token and metrics pushing interval configuration.

func (*InfluxDB2) SetDefaults

func (i *InfluxDB2) SetDefaults()

SetDefaults sets the default values.

type IngressLog

type IngressLog struct {
	Level   string `` /* 127-byte string literal not displayed */
	Format  string `` /* 133-byte string literal not displayed */
	NoColor bool   `` /* 165-byte string literal not displayed */

	FilePath   string `` /* 152-byte string literal not displayed */
	MaxSize    int    `` /* 168-byte string literal not displayed */
	MaxAge     int    `` /* 196-byte string literal not displayed */
	MaxBackups int    `` /* 154-byte string literal not displayed */
	Compress   bool   `` /* 174-byte string literal not displayed */

	OTLP *OTelLog `` /* 158-byte string literal not displayed */
}

IngressLog holds the configuration settings for the ingress logger.

func (*IngressLog) SetDefaults

func (l *IngressLog) SetDefaults()

SetDefaults sets the default values.

type Metrics

type Metrics struct {
	AddInternals bool `` /* 182-byte string literal not displayed */

	Prometheus *Prometheus `` /* 182-byte string literal not displayed */
	Datadog    *Datadog    `` /* 170-byte string literal not displayed */
	StatsD     *Statsd     `` /* 166-byte string literal not displayed */
	InfluxDB2  *InfluxDB2  `` /* 180-byte string literal not displayed */
	OTLP       *OTLP       `` /* 167-byte string literal not displayed */
}

Metrics provides options to expose and send Ingress metrics to different third party monitoring systems.

type OTLP

type OTLP struct {
	GRPC *OTelGRPC `` /* 182-byte string literal not displayed */
	HTTP *OTelHTTP `` /* 182-byte string literal not displayed */

	AddEntryPointsLabels bool              `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool              `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool              `` /* 160-byte string literal not displayed */
	ExplicitBoundaries   []float64         `` /* 167-byte string literal not displayed */
	PushInterval         types.Duration    `` /* 163-byte string literal not displayed */
	ServiceName          string            `` /* 159-byte string literal not displayed */
	ResourceAttributes   map[string]string `` /* 187-byte string literal not displayed */
}

OTLP contains specific configuration used by the OpenTelemetry Metrics exporter.

func (*OTLP) SetDefaults

func (o *OTLP) SetDefaults()

SetDefaults sets the default values.

type OTelGRPC

type OTelGRPC struct {
	Endpoint string            `` /* 144-byte string literal not displayed */
	Insecure bool              `` /* 158-byte string literal not displayed */
	TLS      *types.ClientTLS  `` /* 136-byte string literal not displayed */
	Headers  map[string]string `description:"Headers sent with payload." json:"headers,omitempty" toml:"headers,omitempty" yaml:"headers,omitempty"`
}

OTelGRPC provides configuration settings for the gRPC open-telemetry.

func (*OTelGRPC) SetDefaults

func (o *OTelGRPC) SetDefaults()

SetDefaults sets the default values.

type OTelHTTP

type OTelHTTP struct {
	Endpoint string            `` /* 158-byte string literal not displayed */
	TLS      *types.ClientTLS  `` /* 136-byte string literal not displayed */
	Headers  map[string]string `description:"Headers sent with payload." json:"headers,omitempty" toml:"headers,omitempty" yaml:"headers,omitempty"`
}

OTelHTTP provides configuration settings for the HTTP open-telemetry.

func (*OTelHTTP) SetDefaults

func (o *OTelHTTP) SetDefaults()

SetDefaults sets the default values.

type OTelLog

type OTelLog struct {
	ServiceName        string            `` /* 159-byte string literal not displayed */
	ResourceAttributes map[string]string `` /* 173-byte string literal not displayed */
	GRPC               *OTelGRPC         `` /* 182-byte string literal not displayed */
	HTTP               *OTelHTTP         `` /* 182-byte string literal not displayed */
}

OTelLog provides configuration settings for the open-telemetry logger.

func (*OTelLog) NewLoggerProvider

func (o *OTelLog) NewLoggerProvider(ctx context.Context) (*otelsdk.LoggerProvider, error)

NewLoggerProvider creates a new OpenTelemetry logger provider.

func (*OTelLog) SetDefaults

func (o *OTelLog) SetDefaults()

SetDefaults sets the default values.

type OTelTracing

type OTelTracing struct {
	GRPC *OTelGRPC `` /* 182-byte string literal not displayed */
	HTTP *OTelHTTP `` /* 182-byte string literal not displayed */
}

OTelTracing provides configuration settings for the open-telemetry tracer.

func (*OTelTracing) SetDefaults

func (c *OTelTracing) SetDefaults()

SetDefaults sets the default values.

func (*OTelTracing) Setup

func (c *OTelTracing) Setup(ctx context.Context, serviceName string, sampleRate float64, resourceAttributes map[string]string) (trace.Tracer, io.Closer, error)

Setup sets up the tracer.

type Prometheus

type Prometheus struct {
	Buckets              []float64         `` /* 131-byte string literal not displayed */
	AddEntryPointsLabels bool              `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool              `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool              `` /* 160-byte string literal not displayed */
	EntryPoint           string            `description:"EntryPoint" json:"entryPoint,omitempty" toml:"entryPoint,omitempty" yaml:"entryPoint,omitempty" export:"true"`
	ManualRouting        bool              `` /* 135-byte string literal not displayed */
	HeaderLabels         map[string]string `` /* 252-byte string literal not displayed */
}

Prometheus can contain specific configuration used by the Prometheus Metrics exporter.

func (*Prometheus) SetDefaults

func (p *Prometheus) SetDefaults()

SetDefaults sets the default values.

type Statistics

type Statistics struct {
	RecentErrors int `` /* 149-byte string literal not displayed */
}

Statistics provides options for monitoring request and response stats.

func (*Statistics) SetDefaults

func (s *Statistics) SetDefaults()

SetDefaults sets the default values.

type Statsd

type Statsd struct {
	Address              string         `description:"StatsD address." json:"address,omitempty" toml:"address,omitempty" yaml:"address,omitempty"`
	PushInterval         types.Duration `` /* 139-byte string literal not displayed */
	AddEntryPointsLabels bool           `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool           `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool           `` /* 160-byte string literal not displayed */
	Prefix               string         `` /* 137-byte string literal not displayed */
}

Statsd contains address and metrics pushing interval configuration.

func (*Statsd) SetDefaults

func (s *Statsd) SetDefaults()

SetDefaults sets the default values.

type TracingVerbosity

type TracingVerbosity string
const (
	MinimalVerbosity  TracingVerbosity = "minimal"
	DetailedVerbosity TracingVerbosity = "detailed"
)

func (TracingVerbosity) Allows

func (v TracingVerbosity) Allows(verbosity TracingVerbosity) bool

Jump to

Keyboard shortcuts

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