util

package
v0.0.0-...-f6b4a90 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DynamicFromField

func DynamicFromField(s string) func(map[string]interface{}) string

DynamicFromField return a `function` with based on given str if str consist xxx{{field}}xxx, the `function` will replace `field` with doc[field] otherwise, the `function` simply return s

func EndDoc

func EndDoc() map[string]interface{}

func IsEndDoc

func IsEndDoc(doc map[string]interface{}) bool

func IsHttp

func IsHttp(url string) bool

func IsSoFile

func IsSoFile(url string) bool

IsSoFile check if a given name has .so in the end

func LoadPlugin

func LoadPlugin(url string) (*plugin.Plugin, error)

func SigControl

func SigControl(handler func()) struct{}

SigControl provides a block over SIGTERM(Ctrl-C) and SIGINT which provides a graceful shutdown control when pod is killed

func SubMatchMapRegex

func SubMatchMapRegex(reg string, str string) (map[string]string, error)

func YamlConvert

func YamlConvert(contentMapStr map[string]interface{}, target interface{}) error

YamlConvert try to convert contentMapStr to target with yaml (un)marshal

Types

type Fragment

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

func (*Fragment) UnmarshalYAML

func (f *Fragment) UnmarshalYAML(value *yaml.Node) error

type IncludeProcessor

type IncludeProcessor struct {
	Target interface{}
}

func (*IncludeProcessor) UnmarshalYAML

func (i *IncludeProcessor) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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