Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HexConversion ¶
func HexConversion(v interface{}) []byte
HexConversion returns a hex-encoded string
func Int64ToDateString ¶
func Int64ToDateString(v interface{}) []byte
Int64ToDateString returns the value as a RFC3339 date string. If the type isn't an int64 or *wrapperspb.Int64Value type it will return a blank
Types ¶
type Builder ¶
type Builder struct { TemplateString string Transforms TransformFunctionMap Parameters interface{} }
Builder is an type to build and configure template instances.
func (*Builder) WithJSONMarshaler ¶
func (t *Builder) WithJSONMarshaler(marshaler JSONMarshaler) *Builder
func (*Builder) WithParameters ¶
WithParameters sets the parameter type used for the template. When the structure is built it will use this parameter struct to validate the template
func (*Builder) WithTransforms ¶
func (t *Builder) WithTransforms(transformMap TransformFunctionMap) *Builder
WithTransforms modifies the transform function map for the template. The transform function map is used to apply transformations to fields in the merged data structure. They are simple strings with no parameters and the key to the
type JSONMarshaler ¶
func DefaultMarshaler ¶
func DefaultMarshaler() JSONMarshaler
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template is the main templating engine
type TransformFunc ¶
type TransformFunc func(interface{}) []byte
TransformFunc is the transformation function for template expressions
func DefaultJSONTransformFunc ¶
func DefaultJSONTransformFunc(marshaler JSONMarshaler) TransformFunc
DefaultJSONTransformFunc is the default JSON transform function
type TransformFunctionMap ¶
type TransformFunctionMap map[string]TransformFunc
TransformFunctionMap is the function transform map for the templates.