Documentation ¶
Index ¶
- Variables
- func CreateWriter() codeWriter
- type CodeWriter
- type Declaration
- type ImportDeclaration
- type StructDecl
- func (s *StructDecl) AddMembers(members ...Declaration) *StructDecl
- func (*StructDecl) Declaration()
- func (s *StructDecl) FilePrivate() *StructDecl
- func (s *StructDecl) Internal() *StructDecl
- func (s *StructDecl) Private() *StructDecl
- func (s *StructDecl) Public() *StructDecl
- func (s *StructDecl) WriteCode(writer CodeWriter)
- type Unit
- type VarDeclaration
- func (v *VarDeclaration) Declaration()
- func (v *VarDeclaration) FilePrivate() *VarDeclaration
- func (v *VarDeclaration) InitWith(value Writable) *VarDeclaration
- func (v *VarDeclaration) Internal() *VarDeclaration
- func (v *VarDeclaration) Private() *VarDeclaration
- func (v *VarDeclaration) Public() *VarDeclaration
- func (v *VarDeclaration) SimpleAttributes(names ...string) *VarDeclaration
- func (v *VarDeclaration) WriteCode(writer CodeWriter)
- type Writable
- type WritableCode
Constants ¶
This section is empty.
Variables ¶
View Source
var False = Code("false")
View Source
var Null = Code("null")
View Source
var True = Code("true")
Functions ¶
func CreateWriter ¶
func CreateWriter() codeWriter
Types ¶
type CodeWriter ¶
type CodeWriter interface { Begin() End() Eol() Write(code string) OpenBlock() CloseBlock() }
type Declaration ¶
type Declaration interface { Declaration() Writable }
type ImportDeclaration ¶
type ImportDeclaration struct {
// contains filtered or unexported fields
}
func Import ¶
func Import(moduleName string) ImportDeclaration
func (*ImportDeclaration) WriteCode ¶
func (id *ImportDeclaration) WriteCode(writer CodeWriter)
type StructDecl ¶
type StructDecl struct {
// contains filtered or unexported fields
}
func NewStruct ¶
func NewStruct(name string) *StructDecl
func (*StructDecl) AddMembers ¶
func (s *StructDecl) AddMembers(members ...Declaration) *StructDecl
func (*StructDecl) Declaration ¶
func (*StructDecl) Declaration()
func (*StructDecl) FilePrivate ¶
func (s *StructDecl) FilePrivate() *StructDecl
func (*StructDecl) Internal ¶
func (s *StructDecl) Internal() *StructDecl
func (*StructDecl) Private ¶
func (s *StructDecl) Private() *StructDecl
func (*StructDecl) Public ¶
func (s *StructDecl) Public() *StructDecl
func (*StructDecl) WriteCode ¶
func (s *StructDecl) WriteCode(writer CodeWriter)
type Unit ¶
type Unit struct {
// contains filtered or unexported fields
}
Unit represents a Swift source file
func (*Unit) AddDeclarations ¶
func (u *Unit) AddDeclarations(decls ...Declaration) *Unit
func (*Unit) AddImports ¶
func (u *Unit) AddImports(imports ...ImportDeclaration) *Unit
type VarDeclaration ¶
type VarDeclaration struct {
// contains filtered or unexported fields
}
func Var ¶
func Var(name, typeName string) *VarDeclaration
func (*VarDeclaration) Declaration ¶
func (v *VarDeclaration) Declaration()
func (*VarDeclaration) FilePrivate ¶
func (v *VarDeclaration) FilePrivate() *VarDeclaration
func (*VarDeclaration) InitWith ¶
func (v *VarDeclaration) InitWith(value Writable) *VarDeclaration
func (*VarDeclaration) Internal ¶
func (v *VarDeclaration) Internal() *VarDeclaration
func (*VarDeclaration) Private ¶
func (v *VarDeclaration) Private() *VarDeclaration
func (*VarDeclaration) Public ¶
func (v *VarDeclaration) Public() *VarDeclaration
func (*VarDeclaration) SimpleAttributes ¶
func (v *VarDeclaration) SimpleAttributes(names ...string) *VarDeclaration
SimpleAttributes adds simple attributes to the variable declaration. Simple here means attributes with no arguments.
func (*VarDeclaration) WriteCode ¶
func (v *VarDeclaration) WriteCode(writer CodeWriter)
type Writable ¶
type Writable interface {
WriteCode(writer CodeWriter)
}
type WritableCode ¶
type WritableCode struct {
// contains filtered or unexported fields
}
func C ¶
func C(code string) *WritableCode
func Code ¶
func Code(code string) *WritableCode
func Int ¶
func Int(value int) *WritableCode
func Str ¶
func Str(value string) *WritableCode
func (*WritableCode) WriteCode ¶
func (w *WritableCode) WriteCode(writer CodeWriter)
Click to show internal directories.
Click to hide internal directories.