Documentation ¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func ContainsString(list []string, value string) bool
- func DecodeYAMLLibObject(yamlData interface{}) interface{}
- func ExitFatal(a ...interface{})
- func ExitFatalf(format string, a ...interface{})
- func ExtendMap(original map[string]interface{}, extension map[string]interface{}) map[string]interface{}
- func ExtendStringList(original []string, extension []string) []string
- func GetByJSONPointer(inData interface{}, key string) (interface{}, error)
- func GetContent(url string) ([]byte, error)
- func GetEnvMap() map[string]string
- func GetSortedKeys(object map[string]interface{}) []string
- func Index(slice []string, elem string) int
- func LoadFile(filePath string) (interface{}, error)
- func LoadMap(filePath string) (map[string]interface{}, error)
- func LoadTemplate(filePath string, params interface{}) (map[string]interface{}, error)
- func Match(a interface{}, b interface{}) bool
- func MatchAsJSON(expected interface{}) types.GomegaMatcher
- func MaybeInt(value interface{}) int
- func MaybeList(value interface{}) []interface{}
- func MaybeMap(data interface{}) map[string]interface{}
- func MaybeString(data interface{}) string
- func MaybeStringList(data interface{}) []string
- func MustAsset(name string) []byte
- func PublicKeyFile(file string) ssh.AuthMethod
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func SaveFile(file string, data interface{}) error
- func TempFile(dir string, prefix string, suffix string) (*os.File, error)
- type Config
- func (config *Config) GetBool(key string, defaultValue bool) bool
- func (config *Config) GetInt(key string, defaultValue int) int
- func (config *Config) GetList(key string, defaultValue []interface{}) []interface{}
- func (config *Config) GetParam(key string, defaultValue interface{}) interface{}
- func (config *Config) GetString(key, defaultValue string) string
- func (config *Config) GetStringList(key string, defaultValue []string) []string
- func (config *Config) ReadConfig(path string) error
- type Counter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func ContainsString ¶
ContainsString checks if we have a string in a string list
func DecodeYAMLLibObject ¶
func DecodeYAMLLibObject(yamlData interface{}) interface{}
DecodeYAMLLibObject decodes interface format yaml.v2 lib returns map as map[interface{}]interface{} while gohan lib uses map[string]interface{} so we need to convert it here
func ExtendMap ¶
func ExtendMap(original map[string]interface{}, extension map[string]interface{}) map[string]interface{}
ExtendMap extends a map from existing one
func ExtendStringList ¶
ExtendStringList appends a value if it isn't in base list
func GetByJSONPointer ¶
GetByJSONPointer returns subdata of json using json pointer
func GetContent ¶
GetContent loads file from remote or local
func GetSortedKeys ¶
GetSortedKeys returns sorted keys of map[string]interface{}
func LoadFile ¶
LoadFile loads object from file. suffix of filepath will be used as file type. currently, json and yaml is supported
func LoadMap ¶
LoadMap loads map object from file. suffix of filepath will be used as file type. currently, json and yaml is supported
func LoadTemplate ¶
LoadTemplate loads object from file. suffix of filepath will be used as file type. currently, json and yaml is supported
func MatchAsJSON ¶
func MatchAsJSON(expected interface{}) types.GomegaMatcher
MatchAsJSON checks whether the provided arguments are equivalent after being marshalled as JSONs
func MaybeList ¶
func MaybeList(value interface{}) []interface{}
MaybeList tries cast to list otherwise returns empty object
func MaybeMap ¶
func MaybeMap(data interface{}) map[string]interface{}
MaybeMap returns empty map if data is nil
func MaybeStringList ¶
func MaybeStringList(data interface{}) []string
MaybeStringList returns empty list if data is nil
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func PublicKeyFile ¶
func PublicKeyFile(file string) ssh.AuthMethod
PublicKeyFile read file and return ssh public keys
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config stores configuration parameters for api server
func (*Config) GetStringList ¶
GetStringList returns string list parameter from config
func (*Config) ReadConfig ¶
ReadConfig reads data from config file Config file can be yaml or json file