Documentation ¶
Index ¶
- Variables
- func FuncMap() template.FuncMap
- func GenCode(artifacts map[string]*compiler.Artifact, config *Config) error
- type CodeFile
- type Config
- type FieldDef
- type Generator
- type Result
- type StructDef
- type StructDefExtractor
- func (self *StructDefExtractor) ExtractEvent(e *abi.Event)
- func (self *StructDefExtractor) ExtractFromAbi(abi *abi.ABI) *StructDefExtractor
- func (self *StructDefExtractor) ExtractFromType(typ *abi.Type) string
- func (self *StructDefExtractor) RenderGoCode(packageName string) (string, error)
- func (self *StructDefExtractor) RenderGoCodeToFile(packageName string, outputDir string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConflictDef = errors.New("conflict struct definition with same name")
Functions ¶
Types ¶
type Generator ¶
type Generator struct { Artifacts map[string]*compiler.Artifact Config *Config // contains filtered or unexported fields }
func NewGenerator ¶
type StructDefExtractor ¶
func LoadStructDef ¶
func LoadStructDef(outputDir string) (*StructDefExtractor, error)
func NewStructDefExtractor ¶
func NewStructDefExtractor() *StructDefExtractor
func (*StructDefExtractor) ExtractEvent ¶
func (self *StructDefExtractor) ExtractEvent(e *abi.Event)
ExtractEvent generate event type, and record it for not duplicated.
func (*StructDefExtractor) ExtractFromAbi ¶
func (self *StructDefExtractor) ExtractFromAbi(abi *abi.ABI) *StructDefExtractor
func (*StructDefExtractor) ExtractFromType ¶
func (self *StructDefExtractor) ExtractFromType(typ *abi.Type) string
func (*StructDefExtractor) RenderGoCode ¶
func (self *StructDefExtractor) RenderGoCode(packageName string) (string, error)
func (*StructDefExtractor) RenderGoCodeToFile ¶
func (self *StructDefExtractor) RenderGoCodeToFile(packageName string, outputDir string) error
Click to show internal directories.
Click to hide internal directories.