Documentation
¶
Index ¶
- type BuildContext
- type DefaultBuildContext
- type Function
- func (f Function) Begin() int
- func (f Function) Code() code.Code
- func (f Function) End() int
- func (f Function) Exported() bool
- func (f Function) Func() code.Function
- func (f Function) InnerBegin() int
- func (f Function) InnerEnd() int
- func (f Function) Name() string
- func (f Function) ParamBegin() int
- func (f Function) ParamEnd() int
- func (f Function) Params() []code.Parameter
- func (f Function) Receiver() *code.Parameter
- func (f Function) Results() []code.Parameter
- func (f Function) String() string
- type Import
- type ImportInfo
- type Interface
- func (i Interface) Begin() int
- func (i Interface) Code() code.Code
- func (i Interface) End() int
- func (i Interface) Exported() bool
- func (i Interface) InnerBegin() int
- func (i Interface) InnerEnd() int
- func (i Interface) Interface() code.Interface
- func (i Interface) Methods() []InterfaceMethod
- func (i Interface) Name() string
- func (i Interface) String() string
- type InterfaceMethod
- func (f InterfaceMethod) Begin() int
- func (f InterfaceMethod) Code() code.Code
- func (f InterfaceMethod) End() int
- func (f InterfaceMethod) Exported() bool
- func (f InterfaceMethod) InterfaceMethod() code.InterfaceMethod
- func (f InterfaceMethod) Name() string
- func (f InterfaceMethod) Params() []code.Parameter
- func (f InterfaceMethod) Results() []code.Parameter
- func (f InterfaceMethod) String() string
- type Node
- type NodeWithInner
- type Option
- type Options
- type Source
- func (s *Source) AppendCodeToFunction(name string, method *code.RawCode) error
- func (s *Source) AppendFieldToStruct(name string, field *code.StructField) error
- func (s *Source) AppendFunction(fn code.Function) error
- func (s *Source) AppendImport(imp code.Import) error
- func (s *Source) AppendInterface(inf code.Interface) error
- func (s *Source) AppendMethodToInterface(name string, method code.InterfaceMethod) error
- func (s *Source) AppendParameterToFunction(name string, param *code.Parameter) error
- func (s *Source) AppendStructure(structure code.Struct) error
- func (s *Source) CommentInterface(inf, comment string) error
- func (s *Source) CommentInterfaceMethod(inf, method string, comment string) error
- func (s *Source) Functions() (functions []Function)
- func (s *Source) GetFunction(name string) (*Function, error)
- func (s *Source) GetInterface(name string) (*Interface, error)
- func (s *Source) GetStructure(name string) (*Structure, error)
- func (s *Source) Imports() []Import
- func (s *Source) Interfaces() (interfaces []Interface)
- func (s *Source) Package() string
- func (s *Source) String() (string, error)
- func (s *Source) Structures() (structures []Structure)
- type Structure
- func (s Structure) Begin() int
- func (s Structure) Code() code.Code
- func (s Structure) End() int
- func (s Structure) Exported() bool
- func (s Structure) Fields() []StructureField
- func (s Structure) InnerBegin() int
- func (s Structure) InnerEnd() int
- func (s Structure) Name() string
- func (s Structure) String() string
- func (s Structure) Struct() *code.Struct
- type StructureField
- func (f StructureField) Begin() int
- func (f StructureField) Code() code.Code
- func (f StructureField) End() int
- func (f StructureField) Exported() bool
- func (f StructureField) Field() code.StructField
- func (f StructureField) Name() string
- func (f StructureField) String() string
- func (f StructureField) Tags() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildContext ¶
type BuildContext interface { Import(path string) (*ImportInfo, error) Cwd() (string, error) }
type DefaultBuildContext ¶
type DefaultBuildContext struct{}
func (DefaultBuildContext) Cwd ¶
func (d DefaultBuildContext) Cwd() (string, error)
func (DefaultBuildContext) Import ¶
func (d DefaultBuildContext) Import(path string) (*ImportInfo, error)
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
func (Function) InnerBegin ¶
func (Function) ParamBegin ¶
type Import ¶
type Import struct {
// contains filtered or unexported fields
}
Import represents an import
type ImportInfo ¶
type Interface ¶
type Interface struct {
// contains filtered or unexported fields
}
Interface represents a parsed interface
func (Interface) InnerBegin ¶
func (Interface) Methods ¶
func (i Interface) Methods() []InterfaceMethod
type InterfaceMethod ¶
type InterfaceMethod struct {
// contains filtered or unexported fields
}
func (InterfaceMethod) Begin ¶
func (f InterfaceMethod) Begin() int
func (InterfaceMethod) Code ¶
func (f InterfaceMethod) Code() code.Code
func (InterfaceMethod) End ¶
func (f InterfaceMethod) End() int
func (InterfaceMethod) Exported ¶
func (f InterfaceMethod) Exported() bool
func (InterfaceMethod) InterfaceMethod ¶
func (f InterfaceMethod) InterfaceMethod() code.InterfaceMethod
func (InterfaceMethod) Name ¶
func (f InterfaceMethod) Name() string
func (InterfaceMethod) Params ¶
func (f InterfaceMethod) Params() []code.Parameter
func (InterfaceMethod) Results ¶
func (f InterfaceMethod) Results() []code.Parameter
func (InterfaceMethod) String ¶
func (f InterfaceMethod) String() string
type NodeWithInner ¶
type Option ¶
type Option func(*Options)
func WithBuildContext ¶
func WithBuildContext(buildContext BuildContext) Option
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) AppendCodeToFunction ¶
func (*Source) AppendFieldToStruct ¶
func (s *Source) AppendFieldToStruct(name string, field *code.StructField) error
func (*Source) AppendMethodToInterface ¶
func (s *Source) AppendMethodToInterface(name string, method code.InterfaceMethod) error
func (*Source) AppendParameterToFunction ¶
func (*Source) CommentInterface ¶
func (*Source) CommentInterfaceMethod ¶
func (*Source) Interfaces ¶
func (*Source) Structures ¶
type Structure ¶
type Structure struct {
// contains filtered or unexported fields
}
Structure represents a parsed structure
func (Structure) Fields ¶
func (s Structure) Fields() []StructureField
func (Structure) InnerBegin ¶
type StructureField ¶
type StructureField struct {
// contains filtered or unexported fields
}
func (StructureField) Begin ¶
func (f StructureField) Begin() int
func (StructureField) Code ¶
func (f StructureField) Code() code.Code
func (StructureField) End ¶
func (f StructureField) End() int
func (StructureField) Exported ¶
func (f StructureField) Exported() bool
func (StructureField) Field ¶
func (f StructureField) Field() code.StructField
func (StructureField) Name ¶
func (f StructureField) Name() string
func (StructureField) String ¶
func (f StructureField) String() string
func (StructureField) Tags ¶
func (f StructureField) Tags() map[string]string
Click to show internal directories.
Click to hide internal directories.