Documentation ¶
Index ¶
- Variables
- func Base64Decode(v interface{}) (string, error)
- func Base64Encode(v interface{}) (string, error)
- func CreateMap(values ...interface{}) (map[string]interface{}, error)
- func DoArithmetic(a, b interface{}, op rune) (interface{}, error)
- func Filter(regex string, c interface{}) ([]interface{}, error)
- func Getenv(key string, v ...string) string
- func LookupIP(data string) []string
- func LookupSRV(service, proto, name string) []*net.SRV
- func Process(config Config) error
- func ToJson(v interface{}) (string, error)
- func ToYaml(v interface{}) (string, error)
- func UnmarshalJsonArray(data string) ([]interface{}, error)
- func UnmarshalJsonObject(data string) (map[string]interface{}, error)
- type Config
- type Processor
- type TemplateResource
- type TemplateResourceConfig
Constants ¶
This section is empty.
Variables ¶
var ErrEmptySrc = errors.New("empty src template")
Functions ¶
func Base64Decode ¶ added in v0.13.7
func Base64Encode ¶ added in v0.13.7
func CreateMap ¶ added in v0.13.1
CreateMap creates a key-value map of string -> interface{} The i'th is the key and the i+1 is the value
func DoArithmetic ¶ added in v0.13.1
DoArithmetic performs arithmetic operations (+,-,*,/) using reflection to determine the type of the two terms. This func will auto convert string and uint to int64/float64, then apply operations, return float64, or int64
func Getenv ¶ added in v0.13.1
Getenv retrieves the value of the environment variable named by the key. It returns the value, which will the default value if the variable is not present. If no default value was given - returns "".
func UnmarshalJsonArray ¶ added in v0.7.0
func UnmarshalJsonObject ¶ added in v0.7.0
Types ¶
type Processor ¶ added in v0.7.0
type Processor interface {
Process()
}
func IntervalProcessor ¶ added in v0.7.0
type TemplateResource ¶
type TemplateResource struct { CheckCmd string `toml:"check_cmd"` Dest string FileMode os.FileMode Gid int Keys []string Mode string Prefix string ReloadCmd string `toml:"reload_cmd"` Src string StageFile *os.File Uid int // contains filtered or unexported fields }
TemplateResource is the representation of a parsed template resource.
func NewTemplateResource ¶ added in v0.7.0
func NewTemplateResource(tplpath string, config Config) (*TemplateResource, error)
NewTemplateResource creates a TemplateResource.
type TemplateResourceConfig ¶
type TemplateResourceConfig struct {
TemplateResource TemplateResource `toml:"template"`
}
TemplateResourceConfig holds the parsed template resource.