Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyParams(paramsString []string, pkg *pbsubstreams.Package) error
- func BuildMessageDescriptors(pkg *pbsubstreams.Package) (out map[string]*ModuleDescriptor, err error)
- func GenerateMermaidLiveURL(mods *pbsubstreams.Modules) string
- func IsLikelyManifestInput(in string) bool
- func NewSimpleTestModules() []*pbsubstreams.Module
- func NewTestModules() []*pbsubstreams.Module
- func PrintMermaid(mods *pbsubstreams.Modules)
- func SortModuleNamesByGraphTopology(mods []string, g *ModuleGraph) []string
- func TestReadManifest(t testing.T, manifestPath string) *pbsubstreams.Package
- func ValidateModules(mods *pbsubstreams.Modules) error
- type Binary
- type ConfigurationOverride
- type Input
- type Manifest
- type ManifestOverrideConfiguration
- type Module
- type ModuleDescriptor
- type ModuleGraph
- func (g *ModuleGraph) AncestorStoresOf(moduleName string) ([]*pbsubstreams.Module, error)
- func (g *ModuleGraph) AncestorsOf(moduleName string) ([]*pbsubstreams.Module, error)
- func (g *ModuleGraph) ChildrenOf(moduleName string) ([]*pbsubstreams.Module, error)
- func (g *ModuleGraph) Context(moduleName string) (parents []string, children []string, err error)
- func (g *ModuleGraph) GetSources() []string
- func (g *ModuleGraph) GroupedAncestorStores(moduleName string) ([][]*pbsubstreams.Module, error)
- func (g *ModuleGraph) Module(moduleName string) (*pbsubstreams.Module, error)
- func (g *ModuleGraph) ModuleIndexFromName(name string) (int, bool)
- func (g *ModuleGraph) ModuleInitialBlock(moduleName string) (uint64, error)
- func (g *ModuleGraph) ModuleNameFromIndex(index int) string
- func (g *ModuleGraph) Modules() []string
- func (g *ModuleGraph) ModulesDownTo(moduleName string) ([]*pbsubstreams.Module, error)
- func (g *ModuleGraph) MustChildrenOf(moduleName string) []*pbsubstreams.Module
- func (g *ModuleGraph) MustParentsOf(moduleName string) []*pbsubstreams.Module
- func (g *ModuleGraph) ParentStoresOf(moduleName string) ([]*pbsubstreams.Modules, error)
- func (g *ModuleGraph) ParentsOf(moduleName string) ([]*pbsubstreams.Module, error)
- func (graph *ModuleGraph) ResetGraphHashes()
- func (g *ModuleGraph) StoresDownTo(moduleName string) ([]*pbsubstreams.Module, error)
- func (g *ModuleGraph) TopologicalSort() ([]*pbsubstreams.Module, bool)
- func (g *ModuleGraph) TopologicalSortKnownModules(known map[string]bool) ([]*pbsubstreams.Module, bool)
- type ModuleHash
- type ModuleHashes
- type ModuleMarshaler
- type Option
- type PackageMeta
- type PackageMetaOverride
- type PackageOverride
- type Protobuf
- type Reader
- type Sink
- type SinkConfigOverride
- type StreamOutput
Constants ¶
const ( ModuleKindStore = "store" ModuleKindMap = "map" )
const ( OutputValueTypeInt64 = "int64" OutputValueTypeFloat64 = "float64" OutputValueTypeBigInt = "bigint" OutputValueTypeBigDecimal = "bigdecimal" // Deprecated: bigfloat value type replaced with bigdecimal OutputValueTypeBigFloat = "bigfloat" OutputValueTypeString = "string" )
const ( UpdatePolicySet = "set" UpdatePolicySetIfNotExists = "set_if_not_exists" UpdatePolicyAdd = "add" UpdatePolicyMax = "max" UpdatePolicyMin = "min" UpdatePolicyAppend = "append" )
const PrefixSeparator = ":"
const UNSET = math.MaxUint64
Variables ¶
var IPFSTimeout time.Duration
var IPFSURL string
Functions ¶
func ApplyParams ¶ added in v1.1.1
func ApplyParams(paramsString []string, pkg *pbsubstreams.Package) error
func BuildMessageDescriptors ¶ added in v1.0.2
func BuildMessageDescriptors(pkg *pbsubstreams.Package) (out map[string]*ModuleDescriptor, err error)
func GenerateMermaidLiveURL ¶ added in v1.0.1
func GenerateMermaidLiveURL(mods *pbsubstreams.Modules) string
func IsLikelyManifestInput ¶ added in v1.1.12
IsLikelyManifestInput determines if the input is likely a manifest input, which is determined by checking:
- If the input starts with remote prefix ("https://", "http://", "ipfs://", "gs://", "s3://", "az://")
- If the input ends with `.yaml`
- If the input is a directory (we check for path separator)
func NewSimpleTestModules ¶ added in v1.1.1
func NewSimpleTestModules() []*pbsubstreams.Module
NewTestModules can be used in foreign packages for their test suite
func NewTestModules ¶
func NewTestModules() []*pbsubstreams.Module
NewTestModules can be used in foreign packages for their test suite
func PrintMermaid ¶
func PrintMermaid(mods *pbsubstreams.Modules)
func SortModuleNamesByGraphTopology ¶ added in v0.1.0
func SortModuleNamesByGraphTopology(mods []string, g *ModuleGraph) []string
func TestReadManifest ¶ added in v0.1.0
func TestReadManifest(t testing.T, manifestPath string) *pbsubstreams.Package
func ValidateModules ¶
func ValidateModules(mods *pbsubstreams.Modules) error
ValidateModules is run both by the client _and_ the server.
Types ¶
type ConfigurationOverride ¶ added in v1.1.12
type ConfigurationOverride struct { Package *PackageOverride `yaml:"package,omitempty"` Network string `yaml:"network,omitempty"` InitialBlocks map[string]int64 `yaml:"initialBlocks,omitempty"` Params map[string]string `yaml:"params,omitempty"` SinkConfig *SinkConfigOverride `yaml:"sinkConfig,omitempty"` SinkModule string `yaml:"sinkModule,omitempty"` }
type Input ¶
type Manifest ¶
type Manifest struct { SpecVersion string `yaml:"specVersion"` // check that it equals v0.1.0 Package PackageMeta `yaml:"package"` Protobuf Protobuf `yaml:"protobuf"` Imports mapSlice `yaml:"imports"` Binaries map[string]Binary `yaml:"binaries"` Modules []*Module `yaml:"modules"` Params map[string]string `yaml:"params"` Network string `yaml:"network"` Sink *Sink `yaml:"sink"` Graph *ModuleGraph `yaml:"-"` Workdir string `yaml:"-"` }
Manifest is a YAML structure used to create a Package and its list of Modules. The notion of a manifest does not live in protobuf definitions.
func LoadManifestFile ¶ added in v0.1.0
type ManifestOverrideConfiguration ¶ added in v1.1.12
type ManifestOverrideConfiguration struct { Package PackageMetaOverride `yaml:"package"` Network string `yaml:"network"` InitialBlocks map[string]uint64 `yaml:"initialBlocks"` Params map[string]string `yaml:"params"` Workdir string `yaml:"-"` }
func (*ManifestOverrideConfiguration) Apply ¶ added in v1.1.12
func (o *ManifestOverrideConfiguration) Apply(m *Manifest) error
type Module ¶
type Module struct { Name string `yaml:"name"` Doc string `yaml:"doc"` Kind string `yaml:"kind"` InitialBlock *uint64 `yaml:"initialBlock"` UpdatePolicy string `yaml:"updatePolicy"` ValueType string `yaml:"valueType"` Binary string `yaml:"binary"` Inputs []*Input `yaml:"inputs"` Output StreamOutput `yaml:"output"` }
func (*Module) ToProtoWASM ¶
func (m *Module) ToProtoWASM(codeIndex uint32) (*pbsubstreams.Module, error)
type ModuleDescriptor ¶ added in v1.0.2
type ModuleDescriptor struct { // Either or StoreValueType string MapOutputType string ProtoMessageType string MessageDescriptor *desc.MessageDescriptor }
type ModuleGraph ¶
func MustNewModuleGraph ¶ added in v1.1.1
func MustNewModuleGraph(modules []*pbsubstreams.Module) *ModuleGraph
func NewModuleGraph ¶
func NewModuleGraph(modules []*pbsubstreams.Module) (*ModuleGraph, error)
func (*ModuleGraph) AncestorStoresOf ¶
func (g *ModuleGraph) AncestorStoresOf(moduleName string) ([]*pbsubstreams.Module, error)
func (*ModuleGraph) AncestorsOf ¶
func (g *ModuleGraph) AncestorsOf(moduleName string) ([]*pbsubstreams.Module, error)
func (*ModuleGraph) ChildrenOf ¶ added in v1.0.2
func (g *ModuleGraph) ChildrenOf(moduleName string) ([]*pbsubstreams.Module, error)
func (*ModuleGraph) Context ¶ added in v1.0.2
func (g *ModuleGraph) Context(moduleName string) (parents []string, children []string, err error)
func (*ModuleGraph) GetSources ¶
func (g *ModuleGraph) GetSources() []string
func (*ModuleGraph) GroupedAncestorStores ¶
func (g *ModuleGraph) GroupedAncestorStores(moduleName string) ([][]*pbsubstreams.Module, error)
func (*ModuleGraph) Module ¶ added in v0.0.14
func (g *ModuleGraph) Module(moduleName string) (*pbsubstreams.Module, error)
func (*ModuleGraph) ModuleIndexFromName ¶ added in v1.1.1
func (g *ModuleGraph) ModuleIndexFromName(name string) (int, bool)
func (*ModuleGraph) ModuleInitialBlock ¶
func (g *ModuleGraph) ModuleInitialBlock(moduleName string) (uint64, error)
func (*ModuleGraph) ModuleNameFromIndex ¶ added in v1.1.1
func (g *ModuleGraph) ModuleNameFromIndex(index int) string
func (*ModuleGraph) Modules ¶ added in v1.1.1
func (g *ModuleGraph) Modules() []string
func (*ModuleGraph) ModulesDownTo ¶
func (g *ModuleGraph) ModulesDownTo(moduleName string) ([]*pbsubstreams.Module, error)
func (*ModuleGraph) MustChildrenOf ¶ added in v1.0.2
func (g *ModuleGraph) MustChildrenOf(moduleName string) []*pbsubstreams.Module
func (*ModuleGraph) MustParentsOf ¶ added in v1.0.2
func (g *ModuleGraph) MustParentsOf(moduleName string) []*pbsubstreams.Module
func (*ModuleGraph) ParentStoresOf ¶
func (g *ModuleGraph) ParentStoresOf(moduleName string) ([]*pbsubstreams.Modules, error)
func (*ModuleGraph) ParentsOf ¶
func (g *ModuleGraph) ParentsOf(moduleName string) ([]*pbsubstreams.Module, error)
func (*ModuleGraph) ResetGraphHashes ¶ added in v0.0.21
func (graph *ModuleGraph) ResetGraphHashes()
ResetGraphHashes is to be called when you want to force a recomputation of the module hashes.
func (*ModuleGraph) StoresDownTo ¶
func (g *ModuleGraph) StoresDownTo(moduleName string) ([]*pbsubstreams.Module, error)
func (*ModuleGraph) TopologicalSort ¶
func (g *ModuleGraph) TopologicalSort() ([]*pbsubstreams.Module, bool)
func (*ModuleGraph) TopologicalSortKnownModules ¶ added in v1.1.1
func (g *ModuleGraph) TopologicalSortKnownModules(known map[string]bool) ([]*pbsubstreams.Module, bool)
type ModuleHash ¶
type ModuleHash []byte
type ModuleHashes ¶ added in v0.0.21
type ModuleHashes struct {
// contains filtered or unexported fields
}
func NewModuleHashes ¶ added in v0.0.21
func NewModuleHashes() *ModuleHashes
func (*ModuleHashes) Get ¶ added in v0.0.21
func (m *ModuleHashes) Get(moduleName string) string
func (*ModuleHashes) HashModule ¶ added in v0.0.21
func (m *ModuleHashes) HashModule(modules *pbsubstreams.Modules, module *pbsubstreams.Module, graph *ModuleGraph) (ModuleHash, error)
type ModuleMarshaler ¶
type ModuleMarshaler []*pbsubstreams.Module
func (ModuleMarshaler) MarshalJSON ¶
func (m ModuleMarshaler) MarshalJSON() ([]byte, error)
type Option ¶ added in v1.1.12
func SkipModuleOutputTypeValidationReader ¶ added in v0.1.0
func SkipModuleOutputTypeValidationReader() Option
func SkipPackageValidationReader ¶ added in v1.1.8
func SkipPackageValidationReader() Option
func SkipSourceCodeReader ¶
func SkipSourceCodeReader() Option
func WithCollectProtoDefinitions ¶ added in v0.0.21
func WithCollectProtoDefinitions(f func(protoDefinitions []*desc.FileDescriptor)) Option
func WithOverrides ¶ added in v1.1.12
func WithOverrides(overrides ...*ConfigurationOverride) Option
type PackageMeta ¶
type PackageMetaOverride ¶ added in v1.1.12
type PackageMetaOverride struct {
Name string `yaml:"name"`
}
type PackageOverride ¶ added in v1.1.12
type PackageOverride struct {
Name string `yaml:"name,omitempty"`
}
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func MustNewReader ¶ added in v1.1.3
func (*Reader) IsLocalManifest ¶ added in v0.0.21
IsLocalManifest determines if reader's input to read the manifest is a local manifest file, which is determined by ensure it's not a remote package and if the file end with `.yaml`.
func (*Reader) IsRemotePackage ¶ added in v0.0.21
IsRemotePackage determines if reader's input to read the manifest is a remote file accessible over HTTP/HTTPS, Google Cloud Storage, S3 or Azure Storage.
func (*Reader) MustRead ¶ added in v1.1.1
func (r *Reader) MustRead() *pbsubstreams.Package
func (*Reader) ResolvedInput ¶ added in v1.1.3
type SinkConfigOverride ¶ added in v1.1.12
type StreamOutput ¶
type StreamOutput struct { // For 'map' Type string `yaml:"type"` }