ffjsoninception

package
v0.0.0-...-ddc0dc7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMarshalJSON

func CreateMarshalJSON(ic *Inception, si *StructInfo) error

func CreateUnmarshalJSON

func CreateUnmarshalJSON(ic *Inception, si *StructInfo) error

func RenderTemplate

func RenderTemplate(ic *Inception) ([]byte, error)

Types

type ConditionalWrite

type ConditionalWrite struct {
	Queued []string
}

ConditionalWrite is a stack containing a number of pending writes

func (*ConditionalWrite) DeleteLast

func (w *ConditionalWrite) DeleteLast()

DeleteLast will delete the last added write

func (*ConditionalWrite) Flush

func (w *ConditionalWrite) Flush() string

Flush will return all queued writes, and return "" (empty string) in nothing has been queued "buf.WriteByte('" + byte + "')" + '\n' if one bute has been queued. "buf.WriteString(`" + string + "`)" + "\n" if more than one byte has been queued.

func (*ConditionalWrite) FlushTo

func (w *ConditionalWrite) FlushTo(out string) string

func (*ConditionalWrite) GetQueued

func (w *ConditionalWrite) GetQueued() string

GetQueued will return the current queued content without flushing.

func (*ConditionalWrite) Last

func (w *ConditionalWrite) Last() string

Last will return the last added write

func (*ConditionalWrite) Write

func (w *ConditionalWrite) Write(s string)

Write will add a string to be written

func (*ConditionalWrite) WriteFlush

func (w *ConditionalWrite) WriteFlush(s string) string

WriteFlush will add a string and return the Flush result for the queue

type FieldByJsonName

type FieldByJsonName []*StructField

func (FieldByJsonName) Len

func (a FieldByJsonName) Len() int

func (FieldByJsonName) Less

func (a FieldByJsonName) Less(i, j int) bool

func (FieldByJsonName) Swap

func (a FieldByJsonName) Swap(i, j int)

type Inception

type Inception struct {
	InputPath     string
	OutputPath    string
	PackageName   string
	PackagePath   string
	OutputImports map[string]bool
	OutputFuncs   []string

	ResetFields bool
	// contains filtered or unexported fields
}

func NewInception

func NewInception(inputPath string, packageName string, outputPath string, resetFields bool) *Inception

func (*Inception) Add

func (i *Inception) Add(obj shared.InceptionType)

func (*Inception) AddMany

func (i *Inception) AddMany(objs []shared.InceptionType)

func (*Inception) Execute

func (i *Inception) Execute()

type MarshalerFaster

type MarshalerFaster interface {
	MarshalJSONBuf(buf fflib.EncodingBuffer) error
}

type StructField

type StructField struct {
	Name             string
	JsonName         string
	FoldFuncName     string
	Typ              reflect.Type
	OmitEmpty        bool
	ForceString      bool
	HasMarshalJSON   bool
	HasUnmarshalJSON bool
	Pointer          bool
	Tagged           bool
}

type StructInfo

type StructInfo struct {
	Name    string
	Obj     interface{}
	Typ     reflect.Type
	Fields  []*StructField
	Options shared.StructOptions
}

func NewStructInfo

func NewStructInfo(obj shared.InceptionType) *StructInfo

func (*StructInfo) FieldsByFirstByte

func (si *StructInfo) FieldsByFirstByte() map[string][]*StructField

func (*StructInfo) ReverseFields

func (si *StructInfo) ReverseFields() []*StructField

type UnmarshalFaster

type UnmarshalFaster interface {
	UnmarshalJSONFFLexer(l *fflib.FFLexer, state fflib.FFParseState) error
}

Jump to

Keyboard shortcuts

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