Documentation
¶
Overview ¶
Package gen contains all the components for code generation.
Package gen contains all the components for code generation.
Package gen contains all the components for code generation.
Package gen contains all the components for code generation.
Package gen contains all the components for code generation.
Package gen contains all the components for code generation.
Index ¶
- func GenerateEventHandlerLists(writer io.Writer, packageName string) error
- func GenerateEventHandlers(writer io.Writer, contractType specs.ContractType, packageName string, ...) error
- func GenerateEventHandlersFromTemplate(writer io.Writer, tmplData *EventHandlerContractTmplData, gofmt bool, ...) error
- type EventHandlerContractTmplData
- type EventHandlerListContractTmplData
- type EventHandlerListTmplData
- type EventHandlerMethodParam
- type EventHandlerTmplData
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEventHandlerLists ¶
GenerateEventHandlerLists will code gen a function around the event filterers/watchers to return a list of filterers/watchers based on a map of contract simple names to contract address.
func GenerateEventHandlers ¶
func GenerateEventHandlers(writer io.Writer, contractType specs.ContractType, packageName string, handlerName string) error
GenerateEventHandlers will code gen the contract event handlers for a given ContractType. It will output the generated code to the given io.Writer.
func GenerateEventHandlersFromTemplate ¶
func GenerateEventHandlersFromTemplate(writer io.Writer, tmplData *EventHandlerContractTmplData, gofmt bool, handlerName string) error
GenerateEventHandlersFromTemplate will code gen the contract event handlers for the given contract data. It will output the generated code to the given io.Writer. If gofmt is true, will run go formatting on the code before output. packageName specifies for listener or retriever code
Types ¶
type EventHandlerContractTmplData ¶
type EventHandlerContractTmplData struct { PackageName string AdditionalImports []string ContractImportPath string ContractTypePackage string ContractTypeName string DefaultStartBlock int GenTime time.Time EventHandlers []*EventHandlerTmplData }
EventHandlerContractTmplData represents data for a category of contract event methods. Maps to actions in the event handler templates.
type EventHandlerListContractTmplData ¶
EventHandlerListContractTmplData represents the names of the contracts to list
type EventHandlerListTmplData ¶
type EventHandlerListTmplData struct { PackageName string GenTime time.Time Contracts []*EventHandlerListContractTmplData }
EventHandlerListTmplData represents the data passed to the EventHandlerList template.
type EventHandlerMethodParam ¶
type EventHandlerMethodParam struct {
Type string
}
EventHandlerMethodParam represents a value to be passed into the method for starting up event handlers in a smart contract. Maps to actions in the event handler templates.
type EventHandlerTmplData ¶
type EventHandlerTmplData struct { EventMethod string EventType string ParamValues []*EventHandlerMethodParam EventName string }
EventHandlerTmplData represents data for an individual contract event method in a smart contract. Maps to actions in the event handler templates.
type TemplateData ¶
type TemplateData struct {
// contains filtered or unexported fields
}
TemplateData is a struct to store template information