config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package config provide configurations for connections on databases

Index

Constants

This section is empty.

Variables

View Source
var (
	// Client provide the name of server executing
	Client string = ""
)

Functions

func CheckConfig

func CheckConfig() (*os.File, error)

CheckConfig check if exists the config file

func CreateFileConfig

func CreateFileConfig(data []byte) error

CreateFileConfig create config file and put the byte data

func GenerateConfig

func GenerateConfig()

GenerateConfig generates the configuration file from some questions that are answered by the user

func GetConfig

func GetConfig() model.Config

GetConfig using lib yaml.v2 for read the yaml file to get the configuration of hosts and return struct Config{}

func GetOS

func GetOS() string

GetOS return the operating system in use

func GetPathConfigFile

func GetPathConfigFile() string

GetPathConfigFile only darwin and linux are running the configuration

func IsDirectoryExists

func IsDirectoryExists(path string) bool

IsDirectoryExists verify is directory exists

func IsNotEmpty

func IsNotEmpty(config *model.Config, Item []string, subItem func() map[string][]string) (string, error)

IsNotEmpty using the closure MustBeNotEmpty for check if exist the data on the struct Config

func MustBeNotEmpty

func MustBeNotEmpty(v interface{}, require func() []string, sub func() map[string][]string) (string, error)

MustBeNotEmpty check the values the map passed

func Unmarshal

func Unmarshal(reader *csv.Reader, v interface{}) error

Unmarshal check data on the csv string

Types

type FieldMismatch

type FieldMismatch struct {
	// contains filtered or unexported fields
}

FieldMismatch struct used on func Unmarshal

func (*FieldMismatch) Error

func (e *FieldMismatch) Error() string

type UnsupportedType

type UnsupportedType struct {
	Type string
}

UnsupportedType return field string

func (*UnsupportedType) Error

func (e *UnsupportedType) Error() string

Jump to

Keyboard shortcuts

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