output

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FieldSeparator = "\t"
View Source
const ObjectSeparator = "\n"

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultTransformer

type DefaultTransformer struct {
}

func (DefaultTransformer) Execute

func (t DefaultTransformer) Execute(data interface{}) (interface{}, error)

type JmesPathTransformer

type JmesPathTransformer struct {
	Query string
}

func (JmesPathTransformer) Execute

func (t JmesPathTransformer) Execute(data interface{}) (interface{}, error)

type JsonOutputWriter

type JsonOutputWriter struct {
	Output      io.Writer
	Transformer Transformer
}

func (JsonOutputWriter) WriteResponse

func (w JsonOutputWriter) WriteResponse(response ResponseInfo) error

type OutputWriter

type OutputWriter interface {
	WriteResponse(response ResponseInfo) error
}

type ResponseInfo

type ResponseInfo struct {
	StatusCode int
	Status     string
	Protocol   string
	Header     map[string][]string
	Body       io.Reader
}

func NewResponseInfo

func NewResponseInfo(statusCode int, status string, protocol string, header map[string][]string, body io.Reader) *ResponseInfo

type TextOutputWriter

type TextOutputWriter struct {
	Output      io.Writer
	Transformer Transformer
}

func (TextOutputWriter) WriteResponse

func (w TextOutputWriter) WriteResponse(response ResponseInfo) error

type Transformer

type Transformer interface {
	Execute(data interface{}) (interface{}, error)
}

Jump to

Keyboard shortcuts

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