util

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 23 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedProtocolScheme = errors.New("unsupported protocol scheme")

Functions

func DecodeStruct

func DecodeStruct[T any](input interface{}) (*T, error)

func DeepCopy

func DeepCopy[T any](in *T) *T

func DeepCopyInto

func DeepCopyInto[T any](out, in *T)

func LoadClientMTLSConfig

func LoadClientMTLSConfig(certs *v1beta1.MTLSSpec) (*tls.Config, error)

func LoadServingCertBundle

func LoadServingCertBundle(certsSpec v1beta1.CertsSpec) (*tls.Certificate, *x509.CertPool, error)

func Must

func Must[T any](t T, err ...error) T

func NewK8sClient

func NewK8sClient(options ClientOptions) (client.Client, error)

func NewProtocolListener

func NewProtocolListener(addr string) (net.Listener, error)

func ParsePEMEncodedCert

func ParsePEMEncodedCert(data []byte) (*x509.Certificate, error)

func ParsePEMEncodedCertChain

func ParsePEMEncodedCertChain(chain []byte) ([]*x509.Certificate, error)

func Pointer

func Pointer[T any](t T) *T

Types

type ClientOptions

type ClientOptions struct {
	Kubeconfig *string
	RestConfig *rest.Config
	Scheme     *runtime.Scheme
}

type DelimiterCodec

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

Implements rbac.Codec

func NewDelimiterCodec

func NewDelimiterCodec(key string, delimiter string) DelimiterCodec

func (DelimiterCodec) Decode

func (d DelimiterCodec) Decode(s string) []string

func (DelimiterCodec) Encode

func (d DelimiterCodec) Encode(ids []string) string

func (DelimiterCodec) Key

func (d DelimiterCodec) Key() string

type Future

type Future[T any] struct {
	// contains filtered or unexported fields
}

func NewFuture

func NewFuture[T any]() *Future[T]

func (*Future[T]) Get

func (f *Future[T]) Get() T

func (*Future[T]) GetContext

func (f *Future[T]) GetContext(ctx context.Context) (_ T, err error)

func (*Future[T]) Set

func (f *Future[T]) Set(object T)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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