generate

package module
v0.0.0-...-e24f41b Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: BSD-3-Clause Imports: 11 Imported by: 0

README

#+TITLE: Jflect

Takes JSON from stdin and outputs go structs to stdout.

* Documentation
[[http:godoc.org/github.com/str1ngs/jflect][godoc.org]]

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotValidSyntax = errors.New("Json reflection is not valid Go syntax")
)

TODO: write proper Usage and README

Functions

func Generate

func Generate(r io.Reader, w io.Writer, structName *string) error

Types

type Field

type Field struct {
	// contains filtered or unexported fields
}

Field data type

func NewField

func NewField(name, gtype string, body ...byte) Field

Simplifies Field construction

type FieldSort

type FieldSort []Field

Provides Sorter interface so we can keep field order

func (FieldSort) Len

func (s FieldSort) Len() int

func (FieldSort) Less

func (s FieldSort) Less(i, j int) bool

func (FieldSort) Swap

func (s FieldSort) Swap(i, j int)

Directories

Path Synopsis
Jflect takes JSON from stdin and outputs go structs to stdout.
Jflect takes JSON from stdin and outputs go structs to stdout.

Jump to

Keyboard shortcuts

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