cgelement

package
v0.0.0-...-c990d3b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCommentPrefix = " "
View Source
const DefaultGeneratedBy = "by unspecified script;"

Variables

This section is empty.

Functions

func GetImportDefaultLabel

func GetImportDefaultLabel(source string) string

Types

type Docblock

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

func NewDocBlock

func NewDocBlock(comments ...string) *Docblock

func (*Docblock) Generate

func (*Docblock) ToInterface

func (b *Docblock) ToInterface() cgi.NodeInterface

func (*Docblock) ToString

func (b *Docblock) ToString(ctx cgi.ContextInterface) (string, error)

type Function

type Function struct {
	Name string
	// todo: generics
	MethodFor *Struct
}

type Import

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

func NewImport

func NewImport(source string) *Import

func (*Import) DefaultLabel

func (i *Import) DefaultLabel() string

func (*Import) Equals

func (i *Import) Equals(compareTo cgi.ImportInterface) bool

func (*Import) Label

func (i *Import) Label() string

func (*Import) SetLabel

func (i *Import) SetLabel(label string) *Import

func (*Import) Source

func (i *Import) Source() string

func (*Import) String

func (i *Import) String() string

type ImportSet

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

func NewImportSet

func NewImportSet(imports ...cgi.ImportInterface) *ImportSet

func (*ImportSet) Add

func (s *ImportSet) Add(imports ...cgi.ImportInterface) (*ImportSet, error)

func (*ImportSet) AddValues

func (s *ImportSet) AddValues(imports []cgi.ImportInterface) (*ImportSet, error)

func (*ImportSet) Generate

func (*ImportSet) GetNamespaceForImport

func (s *ImportSet) GetNamespaceForImport(imp cgi.ImportInterface) string

func (*ImportSet) ImportMap

func (s *ImportSet) ImportMap() map[string]cgi.ImportInterface

func (*ImportSet) MergeWith

func (s *ImportSet) MergeWith(other cgi.ImportSetInterface) (*ImportSet, error)

func (*ImportSet) ToString

func (s *ImportSet) ToString(ctx cgi.ContextInterface) (string, error)

type LineComment

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

func NewGeneratedFileLineComment

func NewGeneratedFileLineComment(generatedBy string) *LineComment

Example: "Code generated by my-generator-script; DO NOT EDIT."

func NewGoGenerateLineComment

func NewGoGenerateLineComment(command string) *LineComment

func NewLineComment

func NewLineComment(comment string, args ...interface{}) *LineComment

func (*LineComment) Generate

func (*LineComment) NoSpaceAfterSlash

func (c *LineComment) NoSpaceAfterSlash() *LineComment

func (*LineComment) SetSpaceAfterSlash

func (c *LineComment) SetSpaceAfterSlash(value bool) *LineComment

func (*LineComment) ToString

func (c *LineComment) ToString(ctx cgi.ContextInterface) (string, error)

type NamedType

type NamedType struct {
	Name string
	Type cgi.TypeInterface
}

type RawText

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

func NewRawText

func NewRawText(text string) *RawText

func (*RawText) Generate

func (*RawText) ToString

func (r *RawText) ToString(ctx cgi.ContextInterface) (string, error)

type Struct

type Struct struct {
	Name string
	// todo: generics
	Functions        []string
	StructProperties []*StructProperty
}

type StructProperty

type StructProperty struct {
	Name string
	// todo: generics
	Type cgi.TypeInterface
}

func (*StructProperty) Generate

func (*StructProperty) ToString

func (p *StructProperty) ToString(ctx cgi.ContextInterface) (string, error)

type Type

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

func NewType

func NewType(name string) *Type

func (*Type) Import

func (t *Type) Import(imp cgi.ImportInterface) *Type

func (*Type) Name

func (t *Type) Name(name string) *Type

func (*Type) ToString

func (t *Type) ToString(ctx cgi.ContextInterface) (string, error)

Jump to

Keyboard shortcuts

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