config

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CipherSuitesToUint16 added in v0.11.7

func CipherSuitesToUint16(ciphers []string) ([]uint16, []string, error)

CipherSuitesToUint16 for a given list of ciphers returns list of corresponding ids, list of insecure ciphers if cipher is unknown, it will return an error

func ParseClientAuthType added in v0.11.7

func ParseClientAuthType(clientAuth string) (tls.ClientAuthType, error)

func ParseClientTLSConfig added in v0.11.7

func ParseClientTLSConfig(config *TLS) (*tls.Config, []string, error)

ParseClientTLSConfig parses TLSConfig as it should be used for HTTPS client mTLS and returns &tls.Config, list of warnings or error if parsing has failed. At this moment warnings are only about insecure ciphers

func ParseCurves added in v0.11.7

func ParseCurves(curveNames []string) ([]tls.CurveID, error)

ParseCurves returns list of tls.CurveIDs that can be passed to tls.Config or error if they are not supported ParseCurves also deduplicate input list

func ParseTLSVersion added in v0.11.7

func ParseTLSVersion(version string) (uint16, error)

ParseTLSVersion converts a TLS version string ("TLS10", "TLS11", "TLS12", "TLS13") to its respective uint16 constant. An empty string defaults to TLS version 1.3.

Returns an error for unknown or invalid versions.

Types

type CertificatePair added in v0.11.7

type CertificatePair struct {
	KeyFile  string `toml:"key"`
	CertFile string `toml:"cert"`
}

type ChunkAutoInterval added in v0.8.0

type ChunkAutoInterval struct {
	// contains filtered or unexported fields
}

func NewChunkAutoInterval added in v0.8.0

func NewChunkAutoInterval() *ChunkAutoInterval

func (*ChunkAutoInterval) GetDefault added in v0.8.0

func (c *ChunkAutoInterval) GetDefault() time.Duration

func (*ChunkAutoInterval) GetInterval added in v0.8.0

func (c *ChunkAutoInterval) GetInterval(unhandledCount int) time.Duration

func (*ChunkAutoInterval) MarshalText added in v0.8.0

func (c *ChunkAutoInterval) MarshalText() ([]byte, error)

func (*ChunkAutoInterval) SetDefault added in v0.8.0

func (c *ChunkAutoInterval) SetDefault(v time.Duration)

func (*ChunkAutoInterval) UnmarshalText added in v0.8.0

func (c *ChunkAutoInterval) UnmarshalText(p []byte) error

UnmarshalText from TOML

type CompAlgo added in v0.10.0

type CompAlgo int
const (
	CompAlgoNone CompAlgo = iota
	CompAlgoLZ4
)

type Compression added in v0.10.0

type Compression struct {
	CompAlgo
}

Compression wrapper for TOML

func (*Compression) MarshalText added in v0.10.0

func (c *Compression) MarshalText() ([]byte, error)

MarshalText encode text with TOML format

func (*Compression) UnmarshalText added in v0.10.0

func (c *Compression) UnmarshalText(text []byte) (err error)

UnmarshalText from TOML

func (*Compression) Value added in v0.10.0

func (c *Compression) Value() CompAlgo

Value return time.Duration value

type Duration

type Duration struct {
	time.Duration
}

Duration wrapper time.Duration for TOML

func (*Duration) MarshalText

func (d *Duration) MarshalText() ([]byte, error)

MarshalText encode text with TOML format

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText from TOML

func (*Duration) Value

func (d *Duration) Value() time.Duration

Value return time.Duration value

type Size added in v0.11.2

type Size int64

func (*Size) UnmarshalText added in v0.11.2

func (u *Size) UnmarshalText(text []byte) error

func (*Size) Value added in v0.11.2

func (u *Size) Value() int64

type TLS added in v0.11.7

type TLS struct {
	Certificates []CertificatePair `toml:"certificates"`
	CACertFiles  []string          `toml:"ca-cert"`
	ClientAuth   string            `toml:"client-auth"`

	ServerName         string   `toml:"server-name"`
	MinVersion         string   `toml:"min-version"` // supported formats: TLS10, TLS11, TLS12, TLS13
	MaxVersion         string   `toml:"max-version"` // supported formats: TLS10, TLS11, TLS12, TLS13
	InsecureSkipVerify bool     `toml:"insecure-skip-verify"`
	Curves             []string `toml:"curves"`
	CipherSuites       []string `toml:"cipher-suites"`
}

Jump to

Keyboard shortcuts

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