util

package
v0.0.0-...-2d43aa0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 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

type ConfigInfo struct {
	FilePath string
	Value    interface{}
}

ConfigInfo is s struct

type FileSource

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

FileSource is a interface

func NewYamlConfigurationSource

func NewYamlConfigurationSource() FileSource

NewYamlConfigurationSource creates new yaml configuration

type FileSourceTypes

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