yaml2go

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Yaml2Go

type Yaml2Go struct {
	Visited   map[line]bool
	StructMap map[string]string
}

Yaml2Go to store converted result

func New

func New() Yaml2Go

New creates Yaml2Go object

func (*Yaml2Go) AppendResult

func (yg *Yaml2Go) AppendResult(structName string, l string)

AppendResult add lines to the result

func (*Yaml2Go) Convert

func (yg *Yaml2Go) Convert(structName string, data []byte) (string, error)

Convert transforms map[string]interface{} to go struct

func (*Yaml2Go) NewStruct

func (yg *Yaml2Go) NewStruct(structName string, parent string) string

NewStruct creates new entry in StructMap result

func (*Yaml2Go) Structify

func (yg *Yaml2Go) Structify(structName, k string, v interface{}, arrayElem bool)

Structify transforms map key values to struct fields structName : parent struct name k, v : fields in the struct

Jump to

Keyboard shortcuts

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