utils

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 16 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureGrpcKlog

func ConfigureGrpcKlog()

ConfigureGrpcKlog wraps grpc logging to use klog

func Dump

func Dump(obj interface{}) string

Dump dumps an object into YAML textual format

func KlogDump

func KlogDump(v klog.Level, heading, prefix string, obj interface{})

Types

type FsWatcher

type FsWatcher struct {
	*fsnotify.Watcher

	Events chan struct{}
	// contains filtered or unexported fields
}

FsWatcher is a wrapper helper for watching files

func CreateFsWatcher

func CreateFsWatcher(ratelimit time.Duration, names ...string) (*FsWatcher, error)

CreateFsWatcher creates a new FsWatcher

type KlogFlagVal

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

KlogFlagVal is a wrapper to allow dynamic control of klog from the config file

func NewKlogFlagVal

func NewKlogFlagVal(f *flag.Flag) *KlogFlagVal

NewKlogFlagVal wraps a klog flag into KlogFlagVal type

func (*KlogFlagVal) DefValue

func (k *KlogFlagVal) DefValue() string

DefValue returns the default value of KlogFlagVal as string

func (*KlogFlagVal) IsBoolFlag

func (k *KlogFlagVal) IsBoolFlag() bool

IsBoolFlag implements flag.boolFlag.IsBoolFlag() for wrapped klog flags.

func (*KlogFlagVal) IsSetFromCmdline

func (k *KlogFlagVal) IsSetFromCmdline() bool

IsSetFromCmdline returns true if the value has been set via Set()

func (*KlogFlagVal) Set

func (k *KlogFlagVal) Set(value string) error

Set implements flag.Value interface

func (*KlogFlagVal) SetFromConfig

func (k *KlogFlagVal) SetFromConfig(value string) error

SetFromConfig sets the value without marking it as set from the cmdline

func (*KlogFlagVal) String

func (k *KlogFlagVal) String() string

String implements flag.Value interface

type RegexpVal

type RegexpVal struct {
	regexp.Regexp
}

RegexpVal is a wrapper for regexp command line flags

func (*RegexpVal) Set

func (a *RegexpVal) Set(val string) error

Set implements the flag.Value interface

func (*RegexpVal) UnmarshalJSON

func (a *RegexpVal) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface from "encoding/json"

type StringSetVal

type StringSetVal map[string]struct{}

StringSetVal is a Value encapsulating a set of comma-separated strings

func (*StringSetVal) Set

func (a *StringSetVal) Set(val string) error

Set implements the flag.Value interface

func (*StringSetVal) String

func (a *StringSetVal) String() string

String implements the flag.Value interface

type StringSliceVal

type StringSliceVal []string

StringSliceVal is a Value encapsulating a slice of comma-separated strings

func (*StringSliceVal) Set

func (a *StringSliceVal) Set(val string) error

Set implements the regexp.Value interface

func (*StringSliceVal) String

func (a *StringSliceVal) String() string

String implements the regexp.Value interface

type TlsConfig

type TlsConfig struct {
	sync.Mutex
	// contains filtered or unexported fields
}

TlsConfig is a TLS config wrapper/helper for cert rotation

func (*TlsConfig) GetConfig

func (c *TlsConfig) GetConfig(*tls.ClientHelloInfo) (*tls.Config, error)

GetConfig returns the current TLS configuration. Intended to be used as the GetConfigForClient callback in tls.Config.

func (*TlsConfig) UpdateConfig

func (c *TlsConfig) UpdateConfig(certFile, keyFile, caFile string) error

UpdateConfig updates the wrapped TLS config

Jump to

Keyboard shortcuts

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