encoding

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 10

Documentation

Overview

encoding is a package of default encodings supplied with mimic.

Each of the encodings match the following func declaration: ``` func XXX(in interface{}) io.Reader { ```

Encodings are called when generating the desired output for a configuration.

Additional encoders should return `io.Reader` and can be imported directly into the configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GhodssYAML

func GhodssYAML(in ...interface{}) io.Reader

GhodssYAML returns reader that encodes anything to YAML using github.com/ghodss/yaml. Desired for e.g: * Kubernetes

func HCL

func HCL(in interface{}) io.Reader

func JSON

func JSON(in interface{}) io.Reader

JSON returns reader that encodes anything to JSON.

func JSONPB

func JSONPB(in proto.Message) io.Reader

JSONPB returns reader that encodes protobuf messages to JSON. NOTE: The jsonpb marshaler behaves slightly differently to go's built in marshaler.

func YAML

func YAML(in ...interface{}) io.Reader

YAML returns reader that encodes anything to YAML using gopkg.in/yaml.v2. Desired for e.g: * Prometheus, Alertmanager configuration

Types

type MarshalFunc

type MarshalFunc func(o interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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