gostruct

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: MIT Imports: 8 Imported by: 0

README

GoStruct - Generate structs from data

Build Status Go Report Card GoDoc GitHub license cover.run

License

Pouch is licensed under the MIT License. See LICENSE for the full license text.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenStruct

func GenStruct(name string, i interface{}) []byte

GenStruct Generating structure code based on data

Types

type Gen

type Gen struct {
	Name  string
	Types map[string][]byte
}

Gen structure generator

func NewGenStruct

func NewGenStruct(name string) *Gen

NewGenStruct Create a new structure generator

func (*Gen) Add

func (g *Gen) Add(name string, val interface{})

Add Add the struct from interface.

func (*Gen) AddByValue

func (g *Gen) AddByValue(name string, val reflect.Value)

AddByValue Add the struct from reflect.Value.

func (*Gen) Generate

func (g *Gen) Generate() []byte

Generate returns struct source code

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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