common

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseFormatter

type BaseFormatter struct {

	// Out formatted to the writer
	Out io.Writer
	// Src data(array, map, struct) for format
	Src interface{}
	// MaxDepth limit depth for array, map data TODO
	MaxDepth int
	// Prefix string for each element
	Prefix string
	// Indent string for format each element
	Indent string
	// ClosePrefix string for last "]", "}"
	ClosePrefix string
	// contains filtered or unexported fields
}

BaseFormatter struct

func (*BaseFormatter) BsWriter

func (f *BaseFormatter) BsWriter() ByteStringWriter

BsWriter build and get

func (*BaseFormatter) Reset

func (f *BaseFormatter) Reset()

Reset after format

func (*BaseFormatter) SetOutput

func (f *BaseFormatter) SetOutput(out io.Writer)

SetOutput writer

type ByteStringWriter

type ByteStringWriter interface {
	io.Writer
	io.ByteWriter
	io.StringWriter
	fmt.Stringer
}

ByteStringWriter interface

type DataFormatter

type DataFormatter interface {
	Format() string
	FormatTo(w io.Writer)
}

DataFormatter interface

Jump to

Keyboard shortcuts

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