Documentation ¶
Index ¶
- Variables
- func CreateWriter() codeWriter
- type AttributeDeclaration
- type ClassDeclaration
- func (self *ClassDeclaration) Abstract() *ClassDeclaration
- func (self *ClassDeclaration) Add(members ...Writable) *ClassDeclaration
- func (self *ClassDeclaration) AddAttributes(attributes ...Writable) *ClassDeclaration
- func (self *ClassDeclaration) Attribute(code string) *ClassDeclaration
- func (self *ClassDeclaration) Case() *ClassDeclaration
- func (self *ClassDeclaration) Constructor(ctor *CtorDeclaration) *ClassDeclaration
- func (self *ClassDeclaration) Extends(baseClassName string, params ...string) *ClassDeclaration
- func (self *ClassDeclaration) Members(statements ...Writable) *ClassDeclaration
- func (self *ClassDeclaration) MembersInline(statements ...Writable) *ClassDeclaration
- func (self *ClassDeclaration) Private() *ClassDeclaration
- func (self *ClassDeclaration) Public() *ClassDeclaration
- func (self *ClassDeclaration) Sealed() *ClassDeclaration
- func (self *ClassDeclaration) With(traitName string) *ClassDeclaration
- func (self *ClassDeclaration) WriteCode(writer CodeWriter)
- type CodeWriter
- type CtorDeclaration
- func (self *CtorDeclaration) AddAttributes(attributes ...Writable) *CtorDeclaration
- func (self *CtorDeclaration) AddImplicitParams(params ...Writable) *CtorDeclaration
- func (self *CtorDeclaration) AddParams(params ...Writable) *CtorDeclaration
- func (self *CtorDeclaration) Attribute(code string) *CtorDeclaration
- func (self *CtorDeclaration) ForCaseClass() *CtorDeclaration
- func (self *CtorDeclaration) ImplicitParam(name string, type_ string) *CtorDeclaration
- func (self *CtorDeclaration) Override() *CtorDeclaration
- func (self *CtorDeclaration) Param(name string, type_ string) *CtorDeclaration
- func (self *CtorDeclaration) ParamPerLine() *CtorDeclaration
- func (self *CtorDeclaration) Private() *CtorDeclaration
- func (self *CtorDeclaration) Public() *CtorDeclaration
- func (self *CtorDeclaration) Val(name string, type_ string) *CtorDeclaration
- func (self *CtorDeclaration) Var(name string, type_ string) *CtorDeclaration
- func (self *CtorDeclaration) WriteCode(writer CodeWriter)
- type EolDefinition
- type ExtendsDeclaration
- type FieldDeclaration
- func (self *FieldDeclaration) AddAttributes(attributes ...Writable) *FieldDeclaration
- func (self *FieldDeclaration) Attribute(code string) *FieldDeclaration
- func (self *FieldDeclaration) Init(init Writable) *FieldDeclaration
- func (self *FieldDeclaration) Override() *FieldDeclaration
- func (self *FieldDeclaration) Val() *FieldDeclaration
- func (self *FieldDeclaration) Var() *FieldDeclaration
- func (self *FieldDeclaration) WriteCode(writer CodeWriter)
- type FieldKind
- type ImportDeclaration
- type MethodDeclaration
- func (self *MethodDeclaration) AddAttributes(attributes ...Writable) *MethodDeclaration
- func (self *MethodDeclaration) AddImplicitParams(params ...Writable) *MethodDeclaration
- func (self *MethodDeclaration) AddParams(params ...Writable) *MethodDeclaration
- func (self *MethodDeclaration) AddStatements(statements ...Writable) *MethodDeclaration
- func (self *MethodDeclaration) Async() *MethodDeclaration
- func (self *MethodDeclaration) Attribute(code string) *MethodDeclaration
- func (self *MethodDeclaration) Body(statements ...Writable) *MethodDeclaration
- func (self *MethodDeclaration) BodyInline(statements ...Writable) *MethodDeclaration
- func (self *MethodDeclaration) ImplicitParam(name string, type_ string) *MethodDeclaration
- func (self *MethodDeclaration) NoParams() *MethodDeclaration
- func (self *MethodDeclaration) Override() *MethodDeclaration
- func (self *MethodDeclaration) Param(name string, type_ string) *MethodDeclaration
- func (self *MethodDeclaration) ParamPerLine() *MethodDeclaration
- func (self *MethodDeclaration) Private() *MethodDeclaration
- func (self *MethodDeclaration) Public() *MethodDeclaration
- func (self *MethodDeclaration) Returns(returnType string) *MethodDeclaration
- func (self *MethodDeclaration) WriteCode(writer CodeWriter)
- type NoCodeDeclaration
- type StatementsDeclaration
- func (self *StatementsDeclaration) Add(code ...Writable) *StatementsDeclaration
- func (self *StatementsDeclaration) Code(codeFormat string, args ...interface{}) *WritableCode
- func (self *StatementsDeclaration) Def(name string) *MethodDeclaration
- func (self *StatementsDeclaration) Eol() *EolDefinition
- func (self *StatementsDeclaration) Line(codeFormat string, args ...interface{}) *WritableCode
- func (self *StatementsDeclaration) Val(name string, type_ string) *FieldDeclaration
- func (self *StatementsDeclaration) Var(name string, type_ string) *FieldDeclaration
- func (self *StatementsDeclaration) WriteCode(writer CodeWriter)
- type TraitDeclaration
- func (self *TraitDeclaration) Add(members ...Writable) *TraitDeclaration
- func (self *TraitDeclaration) AddAttributes(attributes ...Writable) *TraitDeclaration
- func (self *TraitDeclaration) Attribute(code string) *TraitDeclaration
- func (self *TraitDeclaration) Extends(types ...string) *TraitDeclaration
- func (self *TraitDeclaration) Members(members ...Writable) *TraitDeclaration
- func (self *TraitDeclaration) MembersInline(members ...Writable) *TraitDeclaration
- func (self *TraitDeclaration) Private() *TraitDeclaration
- func (self *TraitDeclaration) Public() *TraitDeclaration
- func (self *TraitDeclaration) Sealed() *TraitDeclaration
- func (self *TraitDeclaration) WriteCode(writer CodeWriter)
- type UnitDeclaration
- func (self *UnitDeclaration) AddDeclarations(declarations ...Writable) *UnitDeclaration
- func (self *UnitDeclaration) AddImports(imports ...string) *UnitDeclaration
- func (self *UnitDeclaration) Code() string
- func (self *UnitDeclaration) Import(package_ string) *UnitDeclaration
- func (self *UnitDeclaration) WriteCode(writer CodeWriter)
- type Writable
- type WritableCode
- type WritableList
Constants ¶
This section is empty.
Variables ¶
View Source
var False = Code("false")
View Source
var NoCode = &NoCodeDeclaration{}
View Source
var Null = Code("null")
View Source
var True = Code("true")
Functions ¶
func CreateWriter ¶
func CreateWriter() codeWriter
Types ¶
type AttributeDeclaration ¶
type AttributeDeclaration struct {
// contains filtered or unexported fields
}
func Attribute ¶
func Attribute(code string) *AttributeDeclaration
func (*AttributeDeclaration) WriteCode ¶
func (self *AttributeDeclaration) WriteCode(writer CodeWriter)
type ClassDeclaration ¶
type ClassDeclaration struct {
// contains filtered or unexported fields
}
func CaseClass ¶
func CaseClass(name string) *ClassDeclaration
func CaseObject ¶
func CaseObject(name string) *ClassDeclaration
func Class ¶
func Class(name string) *ClassDeclaration
func Object ¶
func Object(name string) *ClassDeclaration
func (*ClassDeclaration) Abstract ¶
func (self *ClassDeclaration) Abstract() *ClassDeclaration
func (*ClassDeclaration) Add ¶
func (self *ClassDeclaration) Add(members ...Writable) *ClassDeclaration
func (*ClassDeclaration) AddAttributes ¶
func (self *ClassDeclaration) AddAttributes(attributes ...Writable) *ClassDeclaration
func (*ClassDeclaration) Attribute ¶
func (self *ClassDeclaration) Attribute(code string) *ClassDeclaration
func (*ClassDeclaration) Case ¶
func (self *ClassDeclaration) Case() *ClassDeclaration
func (*ClassDeclaration) Constructor ¶
func (self *ClassDeclaration) Constructor(ctor *CtorDeclaration) *ClassDeclaration
func (*ClassDeclaration) Extends ¶
func (self *ClassDeclaration) Extends(baseClassName string, params ...string) *ClassDeclaration
func (*ClassDeclaration) Members ¶
func (self *ClassDeclaration) Members(statements ...Writable) *ClassDeclaration
func (*ClassDeclaration) MembersInline ¶
func (self *ClassDeclaration) MembersInline(statements ...Writable) *ClassDeclaration
func (*ClassDeclaration) Private ¶
func (self *ClassDeclaration) Private() *ClassDeclaration
func (*ClassDeclaration) Public ¶
func (self *ClassDeclaration) Public() *ClassDeclaration
func (*ClassDeclaration) Sealed ¶
func (self *ClassDeclaration) Sealed() *ClassDeclaration
func (*ClassDeclaration) With ¶
func (self *ClassDeclaration) With(traitName string) *ClassDeclaration
func (*ClassDeclaration) WriteCode ¶
func (self *ClassDeclaration) WriteCode(writer CodeWriter)
type CodeWriter ¶
type CodeWriter interface { Eol() Indent() UnIndent() Write(code string) }
type CtorDeclaration ¶
type CtorDeclaration struct {
// contains filtered or unexported fields
}
func Constructor ¶
func Constructor() *CtorDeclaration
func (*CtorDeclaration) AddAttributes ¶
func (self *CtorDeclaration) AddAttributes(attributes ...Writable) *CtorDeclaration
func (*CtorDeclaration) AddImplicitParams ¶
func (self *CtorDeclaration) AddImplicitParams(params ...Writable) *CtorDeclaration
func (*CtorDeclaration) AddParams ¶
func (self *CtorDeclaration) AddParams(params ...Writable) *CtorDeclaration
func (*CtorDeclaration) Attribute ¶
func (self *CtorDeclaration) Attribute(code string) *CtorDeclaration
func (*CtorDeclaration) ForCaseClass ¶
func (self *CtorDeclaration) ForCaseClass() *CtorDeclaration
func (*CtorDeclaration) ImplicitParam ¶
func (self *CtorDeclaration) ImplicitParam(name string, type_ string) *CtorDeclaration
func (*CtorDeclaration) Override ¶
func (self *CtorDeclaration) Override() *CtorDeclaration
func (*CtorDeclaration) Param ¶
func (self *CtorDeclaration) Param(name string, type_ string) *CtorDeclaration
func (*CtorDeclaration) ParamPerLine ¶
func (self *CtorDeclaration) ParamPerLine() *CtorDeclaration
func (*CtorDeclaration) Private ¶
func (self *CtorDeclaration) Private() *CtorDeclaration
func (*CtorDeclaration) Public ¶
func (self *CtorDeclaration) Public() *CtorDeclaration
func (*CtorDeclaration) Val ¶
func (self *CtorDeclaration) Val(name string, type_ string) *CtorDeclaration
func (*CtorDeclaration) Var ¶
func (self *CtorDeclaration) Var(name string, type_ string) *CtorDeclaration
func (*CtorDeclaration) WriteCode ¶
func (self *CtorDeclaration) WriteCode(writer CodeWriter)
type EolDefinition ¶
type EolDefinition struct{}
func Eol ¶
func Eol() *EolDefinition
func (*EolDefinition) WriteCode ¶
func (self *EolDefinition) WriteCode(writer CodeWriter)
type ExtendsDeclaration ¶
type ExtendsDeclaration struct {
// contains filtered or unexported fields
}
func Extends ¶
func Extends(className string, params ...string) *ExtendsDeclaration
func (*ExtendsDeclaration) With ¶
func (self *ExtendsDeclaration) With(traitName string) *ExtendsDeclaration
func (*ExtendsDeclaration) WriteCode ¶
func (self *ExtendsDeclaration) WriteCode(writer CodeWriter)
type FieldDeclaration ¶
type FieldDeclaration struct {
// contains filtered or unexported fields
}
func NewFieldDeclaration ¶
func NewFieldDeclaration(name string, type_ string) *FieldDeclaration
func Param ¶
func Param(name string, type_ string) *FieldDeclaration
func Val ¶
func Val(name string, type_ string) *FieldDeclaration
func Var ¶
func Var(name string, type_ string) *FieldDeclaration
func (*FieldDeclaration) AddAttributes ¶
func (self *FieldDeclaration) AddAttributes(attributes ...Writable) *FieldDeclaration
func (*FieldDeclaration) Attribute ¶
func (self *FieldDeclaration) Attribute(code string) *FieldDeclaration
func (*FieldDeclaration) Init ¶
func (self *FieldDeclaration) Init(init Writable) *FieldDeclaration
func (*FieldDeclaration) Override ¶
func (self *FieldDeclaration) Override() *FieldDeclaration
func (*FieldDeclaration) Val ¶
func (self *FieldDeclaration) Val() *FieldDeclaration
func (*FieldDeclaration) Var ¶
func (self *FieldDeclaration) Var() *FieldDeclaration
func (*FieldDeclaration) WriteCode ¶
func (self *FieldDeclaration) WriteCode(writer CodeWriter)
type ImportDeclaration ¶
type ImportDeclaration struct {
// contains filtered or unexported fields
}
func Import ¶
func Import(package_ string) *ImportDeclaration
func (*ImportDeclaration) WriteCode ¶
func (self *ImportDeclaration) WriteCode(writer CodeWriter)
type MethodDeclaration ¶
type MethodDeclaration struct {
// contains filtered or unexported fields
}
func Def ¶
func Def(name string) *MethodDeclaration
func (*MethodDeclaration) AddAttributes ¶
func (self *MethodDeclaration) AddAttributes(attributes ...Writable) *MethodDeclaration
func (*MethodDeclaration) AddImplicitParams ¶
func (self *MethodDeclaration) AddImplicitParams(params ...Writable) *MethodDeclaration
func (*MethodDeclaration) AddParams ¶
func (self *MethodDeclaration) AddParams(params ...Writable) *MethodDeclaration
func (*MethodDeclaration) AddStatements ¶
func (self *MethodDeclaration) AddStatements(statements ...Writable) *MethodDeclaration
func (*MethodDeclaration) Async ¶
func (self *MethodDeclaration) Async() *MethodDeclaration
func (*MethodDeclaration) Attribute ¶
func (self *MethodDeclaration) Attribute(code string) *MethodDeclaration
func (*MethodDeclaration) Body ¶
func (self *MethodDeclaration) Body(statements ...Writable) *MethodDeclaration
func (*MethodDeclaration) BodyInline ¶
func (self *MethodDeclaration) BodyInline(statements ...Writable) *MethodDeclaration
func (*MethodDeclaration) ImplicitParam ¶
func (self *MethodDeclaration) ImplicitParam(name string, type_ string) *MethodDeclaration
func (*MethodDeclaration) NoParams ¶
func (self *MethodDeclaration) NoParams() *MethodDeclaration
func (*MethodDeclaration) Override ¶
func (self *MethodDeclaration) Override() *MethodDeclaration
func (*MethodDeclaration) Param ¶
func (self *MethodDeclaration) Param(name string, type_ string) *MethodDeclaration
func (*MethodDeclaration) ParamPerLine ¶
func (self *MethodDeclaration) ParamPerLine() *MethodDeclaration
func (*MethodDeclaration) Private ¶
func (self *MethodDeclaration) Private() *MethodDeclaration
func (*MethodDeclaration) Public ¶
func (self *MethodDeclaration) Public() *MethodDeclaration
func (*MethodDeclaration) Returns ¶
func (self *MethodDeclaration) Returns(returnType string) *MethodDeclaration
func (*MethodDeclaration) WriteCode ¶
func (self *MethodDeclaration) WriteCode(writer CodeWriter)
type NoCodeDeclaration ¶
type NoCodeDeclaration struct { }
func (*NoCodeDeclaration) WriteCode ¶
func (self *NoCodeDeclaration) WriteCode(writer CodeWriter)
type StatementsDeclaration ¶
type StatementsDeclaration struct {
// contains filtered or unexported fields
}
func Block ¶
func Block(statements ...Writable) *StatementsDeclaration
func Scope ¶
func Scope(statements ...Writable) *StatementsDeclaration
func ScopeInline ¶
func ScopeInline(statements ...Writable) *StatementsDeclaration
func Statements ¶
func Statements(statements ...Writable) *StatementsDeclaration
func (*StatementsDeclaration) Add ¶
func (self *StatementsDeclaration) Add(code ...Writable) *StatementsDeclaration
func (*StatementsDeclaration) Code ¶
func (self *StatementsDeclaration) Code(codeFormat string, args ...interface{}) *WritableCode
func (*StatementsDeclaration) Def ¶
func (self *StatementsDeclaration) Def(name string) *MethodDeclaration
func (*StatementsDeclaration) Eol ¶
func (self *StatementsDeclaration) Eol() *EolDefinition
func (*StatementsDeclaration) Line ¶
func (self *StatementsDeclaration) Line(codeFormat string, args ...interface{}) *WritableCode
func (*StatementsDeclaration) Val ¶
func (self *StatementsDeclaration) Val(name string, type_ string) *FieldDeclaration
func (*StatementsDeclaration) Var ¶
func (self *StatementsDeclaration) Var(name string, type_ string) *FieldDeclaration
func (*StatementsDeclaration) WriteCode ¶
func (self *StatementsDeclaration) WriteCode(writer CodeWriter)
type TraitDeclaration ¶
type TraitDeclaration struct {
// contains filtered or unexported fields
}
func Trait ¶
func Trait(name string) *TraitDeclaration
func (*TraitDeclaration) Add ¶
func (self *TraitDeclaration) Add(members ...Writable) *TraitDeclaration
func (*TraitDeclaration) AddAttributes ¶
func (self *TraitDeclaration) AddAttributes(attributes ...Writable) *TraitDeclaration
func (*TraitDeclaration) Attribute ¶
func (self *TraitDeclaration) Attribute(code string) *TraitDeclaration
func (*TraitDeclaration) Extends ¶
func (self *TraitDeclaration) Extends(types ...string) *TraitDeclaration
func (*TraitDeclaration) Members ¶
func (self *TraitDeclaration) Members(members ...Writable) *TraitDeclaration
func (*TraitDeclaration) MembersInline ¶
func (self *TraitDeclaration) MembersInline(members ...Writable) *TraitDeclaration
func (*TraitDeclaration) Private ¶
func (self *TraitDeclaration) Private() *TraitDeclaration
func (*TraitDeclaration) Public ¶
func (self *TraitDeclaration) Public() *TraitDeclaration
func (*TraitDeclaration) Sealed ¶
func (self *TraitDeclaration) Sealed() *TraitDeclaration
func (*TraitDeclaration) WriteCode ¶
func (self *TraitDeclaration) WriteCode(writer CodeWriter)
type UnitDeclaration ¶
type UnitDeclaration struct {
// contains filtered or unexported fields
}
func Unit ¶
func Unit(package_ string) *UnitDeclaration
func (*UnitDeclaration) AddDeclarations ¶
func (self *UnitDeclaration) AddDeclarations(declarations ...Writable) *UnitDeclaration
func (*UnitDeclaration) AddImports ¶
func (self *UnitDeclaration) AddImports(imports ...string) *UnitDeclaration
func (*UnitDeclaration) Code ¶
func (self *UnitDeclaration) Code() string
func (*UnitDeclaration) Import ¶
func (self *UnitDeclaration) Import(package_ string) *UnitDeclaration
func (*UnitDeclaration) WriteCode ¶
func (self *UnitDeclaration) WriteCode(writer CodeWriter)
type Writable ¶
type Writable interface {
WriteCode(writer CodeWriter)
}
func Dynamic ¶
func Dynamic(dynamic func(code *WritableList)) []Writable
type WritableCode ¶
type WritableCode struct {
// contains filtered or unexported fields
}
func Code ¶
func Code(codeFormat string, args ...interface{}) *WritableCode
func Int ¶
func Int(value int) *WritableCode
func Line ¶
func Line(codeFormat string, args ...interface{}) *WritableCode
func Str ¶
func Str(value string) *WritableCode
func (*WritableCode) Eol ¶
func (self *WritableCode) Eol() *WritableCode
func (*WritableCode) WriteCode ¶
func (self *WritableCode) WriteCode(writer CodeWriter)
type WritableList ¶
type WritableList struct {
// contains filtered or unexported fields
}
func (*WritableList) Add ¶
func (self *WritableList) Add(writable ...Writable)
Click to show internal directories.
Click to hide internal directories.