util

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppName   = "cerbos"
	BuildDate = "unknown"
	Commit    = "unknown"
	Version   = "unknown"
)

Functions

func DefaultTLSConfig

func DefaultTLSConfig() *tls.Config

DefaultTLSConfig returns the default TLS configuration.

func GetFreeListenAddr

func GetFreeListenAddr() (string, error)

func GetFreePort

func GetFreePort() (int, error)

func IsSupportedFileType

func IsSupportedFileType(fileName string) bool

IsSuppportedFileType returns true if the given file has a supported file extension.

func LoadFromJSONOrYAML

func LoadFromJSONOrYAML(fsys fs.FS, path string, dest proto.Message) error

LoadFromJSONOrYAML reads a JSON or YAML encoded protobuf from the given path.

func ParseListenAddress

func ParseListenAddress(listenAddr string) (network, addr string, err error)

ParseListenAddress parses an address and returns the network type and the address to dial. inspired by https://github.com/ghostunnel/ghostunnel/blob/6e58c75c8762fe371c1134e89dd55033a6d577a4/socket/net.go#L31

func ReadJSONOrYAML

func ReadJSONOrYAML(src io.Reader, dest proto.Message) error

func WriteYAML

func WriteYAML(dest io.Writer, data proto.Message) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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