utils

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultLoggingFlags = log.LstdFlags | log.Lmicroseconds | log.Lmsgprefix
)

Variables

This section is empty.

Functions

func Convert

func Convert(i interface{}) interface{}

func GetHost

func GetHost(hostport string) string

func MergeMaps

func MergeMaps(dst, src map[string]interface{}) map[string]interface{}

func NewTLSConfig

func NewTLSConfig(ca, cert, key, clientAuth string, skipVerify, genSelfSigned bool) (*tls.Config, error)

NewTLSConfig generates a *tls.Config based on given CA, certificate, key files and skipVerify flag if certificate and key are missing a self signed key pair is generated. The certificates paths can be local or remote, http(s) and (s)ftp are supported for remote files.

func ReadLocalFile

func ReadLocalFile(ctx context.Context, path string) ([]byte, error)

readLocalFile reads a file from the local file system, unmarshals the content into a map[string]*types.TargetConfig and returns

func SelfSignedCerts

func SelfSignedCerts() (tls.Certificate, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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