Documentation ¶
Index ¶
- Variables
- func DefaultTLSConfig() *tls.Config
- func GetFreeListenAddr() (string, error)
- func GetFreePort() (int, error)
- func IsSupportedFileType(fileName string) bool
- func IsSupportedFileTypeExt(fileName string) (string, bool)
- func IsSupportedTestFile(fileName string) bool
- func LoadFromJSONOrYAML(fsys fs.FS, path string, dest proto.Message) error
- func OpenOneOfSupportedFiles(fsys fs.FS, fileName string) (fs.File, error)
- func ParseListenAddress(listenAddr string) (network, addr string, err error)
- func ReadJSONOrYAML(src io.Reader, dest proto.Message) error
- func WriteYAML(dest io.Writer, data proto.Message) error
Constants ¶
This section is empty.
Variables ¶
var ( AppName = "cerbos" BuildDate = "unknown" Commit = "unknown" Version = "unknown" )
Functions ¶
func DefaultTLSConfig ¶
DefaultTLSConfig returns the default TLS configuration.
func GetFreeListenAddr ¶
func GetFreePort ¶
func IsSupportedFileType ¶
IsSupportedFileType returns true if the given file has a supported file extension.
func IsSupportedFileTypeExt ¶ added in v0.7.0
IsSupportedFileTypeExt returns true and a file extension if the given file has a supported file extension.
func IsSupportedTestFile ¶ added in v0.7.0
IsSupportedTestFile return true if the given file is a supported test file name, i.e. "*_test.{yaml,yml,json}".
func LoadFromJSONOrYAML ¶
LoadFromJSONOrYAML reads a JSON or YAML encoded protobuf from the given path.
func OpenOneOfSupportedFiles ¶ added in v0.7.0
OpenOneOfSupportedFiles attempts to open a fileName adding supported extensions.
func ParseListenAddress ¶
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
Types ¶
This section is empty.