formatter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MPL-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenericUnmarshal

func GenericUnmarshal(data interface{}) ([]map[string]interface{}, error)

GenericUnmarshal Given an arbitrary piece of data, return a slice of json data

func GetFormats

func GetFormats() []string

GetFormats Return a list of formats available in formatters. Useful if you need to check what formatters are available in a standardized way

func OutputData

func OutputData(data interface{}, config *Config) ([]byte, error)

OutputData Main function to return the data we will be printing to the screen. This is where the magic happens!

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice Check if a slice for a string

Types

type Config

type Config struct {
	Format      string
	LimitFields []string
	Template    string
}

Config Structure to pass to formatters. Should include enough config to do the output. You must set the Format here to something like yaml, json, plain, or any other value returned by the GetFormats function

Jump to

Keyboard shortcuts

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