util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//FileConfigSourceConst is a variable of type string
	FileConfigSourceConst = "FileSource"

	//DefaultFilePriority is a variable of type string
	DefaultFilePriority = 0
)

Variables

This section is empty.

Functions

func GenerateTestCertificate

func GenerateTestCertificate(path string, certFileName string, keyFileName string) error

GenerateTestCertificate generates fake certificates and stores them at the path specified. It accepts 3 arguments path, certFileName and keyFileName "path" is the directory path at which the directory is to be created, "certFileName" & "keyFileName" refers to the name of the file to be created without the extension

func GenerateTestYaml

func GenerateTestYaml(test interface{}, path, filename string) error

GenerateTestYaml is a function is used to create a temporary file to be used for testing It accepts 3 arguments:"test" is the interface used to generate the YAML, "path" is the directory path at which the directory is to be created, "filename" is the name of the file to be created without the ".yaml" extension

func LoadConfig

func LoadConfig(confLocation ...string) error

LoadConfig is function to Load Configurations from a specified location. If no location is specified it loads the config from the default location

Types

type ConfigInfo added in v1.0.0

type ConfigInfo struct {
	FilePath string
	Value    interface{}
}

ConfigInfo is s struct

type FileSource added in v1.0.0

type FileSource interface {
	core.ConfigSource
	AddFileSource(filePath string, priority uint32) error
}

FileSource is a interface

func NewYamlConfigurationSource added in v1.0.0

func NewYamlConfigurationSource() FileSource

NewYamlConfigurationSource creates new yaml configuration

type FileSourceTypes added in v1.0.0

type FileSourceTypes string

FileSourceTypes is a string

const (
	//RegularFile is a variable of type string
	RegularFile FileSourceTypes = "RegularFile"
	//Directory is a variable of type string
	Directory FileSourceTypes = "Directory"
	//InvalidFileType is a variable of type string
	InvalidFileType FileSourceTypes = "InvalidType"
)

Jump to

Keyboard shortcuts

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