cfg

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gen

func Gen(c *coder.Coder, base CodeBase)

Types

type CodeBase

type CodeBase struct {
	Structs []coder.GoStruct

	Imports []Import
	// contains filtered or unexported fields
}

func ParseCode

func ParseCode(file *File, syntax string) (*CodeBase, error)

func (*CodeBase) Pkg

func (b *CodeBase) Pkg() string

func (*CodeBase) Tar

func (b *CodeBase) Tar() string

type Collection

type Collection struct {
	Type     string
	Name     string
	Line     int
	Comments []string
	Options  []Option
}

func (*Collection) IsEmpty

func (c *Collection) IsEmpty() bool

type File

type File struct {
	Options []Option
	Cols    []Collection
}

func Parse

func Parse(lines []string) (*File, error)

func (*File) GetCol

func (f *File) GetCol(name, colType string) (*Collection, error)

func (*File) GetColsType

func (f *File) GetColsType(t string) ([]*Collection, error)

func (*File) GetOption

func (f *File) GetOption(name string) (*Option, error)

func (*File) IsEmpty

func (f *File) IsEmpty() bool

type Import

type Import struct {
	Name string
	Path string
	Line int
}

type Option

type Option struct {
	Type  string
	Key   string
	Value string
	Line  int

	Comments      []string
	SuffixComment string
}

Jump to

Keyboard shortcuts

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