Documentation
¶
Index ¶
- Constants
- Variables
- func IsDelta(input *pbsubstreams.Module_Input) bool
- func IsMapInput(input *pbsubstreams.Module_Input) bool
- func IsMapModule(module *pbsubstreams.Module) bool
- func IsStoreInput(input *pbsubstreams.Module_Input) bool
- func IsStoreModule(module *pbsubstreams.Module) bool
- func ReadableStoreDeclaration(name string, store *pbsubstreams.Module_KindStore, ...) string
- func ReadableStoreType(store *pbsubstreams.Module_KindStore, input *pbsubstreams.Module_Input_Store) string
- func WritableStoreDeclaration(store *pbsubstreams.Module_KindStore) string
- func WritableStoreType(store *pbsubstreams.Module_KindStore) string
- type Argument
- type Arguments
- type Engine
- func (e *Engine) Arguments(module *pbsubstreams.Module) ([]string, error)
- func (e *Engine) FunctionSignature(module *pbsubstreams.Module) (*FunctionSignature, error)
- func (e *Engine) GetEngine() *Engine
- func (e *Engine) ModuleArgument(inputs []*pbsubstreams.Module_Input) (Arguments, error)
- func (e *Engine) MustModule(moduleName string) *pbsubstreams.Module
- type FunctionSignature
- type GenerationOptions
- type Generator
- type ProtoGenerator
Constants ¶
View Source
const EthereumBlockManifest = "sf.ethereum.type.v2.Block"
View Source
const EthereumBlockRust = "substreams_ethereum::pb::eth::v2::Block"
View Source
const SubstreamsClock = "sf.substreams.v1.Clock"
View Source
const SubstreamsClockRust = "substreams::pb::substreams::Clock"
Variables ¶
View Source
var StoreType = map[string]string{
"bytes": "Raw",
"string": "String",
"bigint": "BigInt",
"bigdecimal": "BigDecimal",
"bigfloat": "BigDecimal",
"int64": "I64",
"i64": "I64",
"float64": "Float64",
}
View Source
var UpdatePoliciesMap = map[string]string{
"UPDATE_POLICY_UNSET": "Unset",
"UPDATE_POLICY_SET": "Set",
"UPDATE_POLICY_SET_IF_NOT_EXISTS": "SetIfNotExist",
"UPDATE_POLICY_ADD": "Add",
"UPDATE_POLICY_MIN": "Min",
"UPDATE_POLICY_MAX": "Max",
"UPDATE_POLICY_APPEND": "Append",
}
Functions ¶
func IsDelta ¶
func IsDelta(input *pbsubstreams.Module_Input) bool
func IsMapInput ¶
func IsMapInput(input *pbsubstreams.Module_Input) bool
func IsMapModule ¶
func IsMapModule(module *pbsubstreams.Module) bool
func IsStoreInput ¶
func IsStoreInput(input *pbsubstreams.Module_Input) bool
func IsStoreModule ¶
func IsStoreModule(module *pbsubstreams.Module) bool
func ReadableStoreDeclaration ¶
func ReadableStoreDeclaration(name string, store *pbsubstreams.Module_KindStore, input *pbsubstreams.Module_Input_Store) string
func ReadableStoreType ¶
func ReadableStoreType(store *pbsubstreams.Module_KindStore, input *pbsubstreams.Module_Input_Store) string
func WritableStoreDeclaration ¶
func WritableStoreDeclaration(store *pbsubstreams.Module_KindStore) string
func WritableStoreType ¶
func WritableStoreType(store *pbsubstreams.Module_KindStore) string
Types ¶
type Argument ¶
type Argument struct {
Name string
Type string
ModuleInput *pbsubstreams.Module_Input
}
func NewArgument ¶
func NewArgument(name string, argType string, moduleInput *pbsubstreams.Module_Input) *Argument
type Engine ¶
type Engine struct {
Package *pbsubstreams.Package
}
func (*Engine) Arguments ¶
func (e *Engine) Arguments(module *pbsubstreams.Module) ([]string, error)
func (*Engine) FunctionSignature ¶
func (e *Engine) FunctionSignature(module *pbsubstreams.Module) (*FunctionSignature, error)
func (*Engine) ModuleArgument ¶
func (e *Engine) ModuleArgument(inputs []*pbsubstreams.Module_Input) (Arguments, error)
func (*Engine) MustModule ¶
func (e *Engine) MustModule(moduleName string) *pbsubstreams.Module
type FunctionSignature ¶
type FunctionSignature struct {
Name string
Type string
OutputType string
StorePolicy string
Arguments Arguments
}
func NewFunctionSignature ¶
func NewFunctionSignature(name string, t string, outType string, storePolicy pbsubstreams.Module_KindStore_UpdatePolicy, arguments Arguments) *FunctionSignature
type GenerationOptions ¶
type GenerationOptions func(options *generateOptions)
func WithTestWriter ¶
func WithTestWriter(w io.Writer) GenerationOptions
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator(pkg *pbsubstreams.Package, protoDefinitions []*desc.FileDescriptor, srcPath string) *Generator
type ProtoGenerator ¶
type ProtoGenerator struct {
// contains filtered or unexported fields
}
func NewProtoGenerator ¶
func NewProtoGenerator(outputPath string, excludedPaths []string) *ProtoGenerator
func (*ProtoGenerator) Generate ¶
func (g *ProtoGenerator) Generate(pkg *pbsubstreams.Package) error
Click to show internal directories.
Click to hide internal directories.