fmtio

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GOPIUM = "gopium"
	GO     = "go"
	JSON   = "json"
	XML    = "xml"
	CSV    = "csv"
	MD     = "md"
	HTML   = "html"
)

list of supported extensions

Variables

View Source
var FSPT = combine(
	flatten,
	fpadfilter,
	shuffle,
	padsync,
	tagsync,
	reindex,
)

FSPT implements ast and combines: - flatten helper - fpadfilter helper - shuffle helper - padsync helper - tagsync helper - reindex helper

Functions

func Buffer

func Buffer() io.ReadWriter

Buffer defines buffer creator helper

func Csvb

func Csvb(rw io.ReadWriter) gopium.Bytes

Csvb defines bytes implementation which serializes flat collection to formatted csv byte slice

func FieldsHtmlt

func FieldsHtmlt(o gopium.Categorized, r gopium.Categorized) ([]byte, error)

FieldsHtmlt defines diff implementation which compares two categorized collections to formatted struct fields html table byte slice

func Jsonb

func Jsonb(sts []gopium.Struct) ([]byte, error)

Jsonb defines bytes implementation which uses json marshal with indent to serialize flat collection to byte slice

func Mdtb

func Mdtb(sts []gopium.Struct) ([]byte, error)

Mdtb defines bytes implementation which serializes flat collection to formatted markdown table byte slice

func SizeAlignMdt

func SizeAlignMdt(o gopium.Categorized, r gopium.Categorized) ([]byte, error)

SizeAlignMdt defines diff implementation which compares two categorized collections to formatted markdown table byte slice

func Xmlb

func Xmlb(sts []gopium.Struct) ([]byte, error)

Xmlb defines bytes implementation which uses xml marshal with indent to serialize flat collection to byte slice

Types

type File

type File struct {
	Name string `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`
	Ext  string `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`

} // struct size: 32 bytes; struct align: 8 bytes; struct aligned size: 32 bytes; - 🌺 gopium @1pkg

File defines writer implementation which creates underlying single file with provided name and ext on provided loc

func (File) Generate

func (f File) Generate(loc string) (io.WriteCloser, error)

Generate file implementation

type Files

type Files struct {
	Ext string `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`

} // struct size: 16 bytes; struct align: 8 bytes; struct aligned size: 16 bytes; - 🌺 gopium @1pkg

Files defines writer implementation which creates underlying files list with provided ext on provided loc

func (Files) Generate

func (f Files) Generate(loc string) (io.WriteCloser, error)

Generate files implementation

type Gofmt

type Gofmt struct{} // struct size: 0 bytes; struct align: 1 bytes; struct aligned size: 0 bytes; - 🌺 gopium @1pkg

Gofmt implements printer by using canonical ast go fmt printer

func (Gofmt) Print

func (p Gofmt) Print(ctx context.Context, w io.Writer, fset *token.FileSet, node ast.Node) error

Print gofmt implementation

type Goprinter

type Goprinter struct {
	// contains filtered or unexported fields

} // struct size: 8 bytes; struct align: 8 bytes; struct aligned size: 8 bytes; - 🌺 gopium @1pkg

Goprinter implements printer by using ast go printer printer

func NewGoprinter

func NewGoprinter(indent int, tabwidth int, usespace bool) Goprinter

NewGoprinter creates instances of goprinter with configs

func (Goprinter) Print

func (p Goprinter) Print(ctx context.Context, w io.Writer, fset *token.FileSet, node ast.Node) error

Print goprinter implementation

type Origin

type Origin struct {
	Writter gopium.Writer `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`

} // struct size: 16 bytes; struct align: 8 bytes; struct aligned size: 16 bytes; - 🌺 gopium @1pkg

Origin defines category writer implementation which simply uses underlying writter

func (Origin) Category

func (o Origin) Category(cat string) error

Category origin implementation

func (Origin) Generate

func (o Origin) Generate(loc string) (io.WriteCloser, error)

Generate origin implementation

type Stdout

type Stdout struct{} // struct size: 0 bytes; struct align: 1 bytes; struct aligned size: 0 bytes; - 🌺 gopium @1pkg

Stdout defines writer implementation which only returns os stdout all the time

func (Stdout) Generate

func (Stdout) Generate(string) (io.WriteCloser, error)

Generate stdout implementation

type Suffix

type Suffix struct {
	Writter gopium.Writer `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`
	Suffix  string        `gopium:"filter_pads,memory_pack,cache_rounding_cpu_l1_discrete,struct_annotate_comment,add_tag_group_force"`
	// contains filtered or unexported fields

} // struct size: 64 bytes; struct align: 8 bytes; struct aligned size: 64 bytes; - 🌺 gopium @1pkg

Suffix defines category writer implementation which replaces category for writer with provided suffixed category

func (*Suffix) Category

func (s *Suffix) Category(cat string) error

Category suffix implementation

func (Suffix) Generate

func (s Suffix) Generate(loc string) (io.WriteCloser, error)

Generate suffix implementation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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