manifest

package
v0.0.5-beta3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 20 Imported by: 14

Documentation

Index

Constants

View Source
const (
	ModuleKindStore = "store"
	ModuleKindMap   = "map"
)
View Source
const (
	UpdatePolicyReplace = "replace"
	UpdatePolicyIgnore  = "ignore"
	UpdatePolicySum     = "sum"
	UpdatePolicyMax     = "max"
	UpdatePolicyMin     = "min"
)
View Source
const UNSET = math.MaxUint64

Variables

View Source
var ModuleNameRegexp *regexp.Regexp

Functions

func HashModuleAsString

func HashModuleAsString(manifest *pbsubstreams.Manifest, graph *ModuleGraph, module *pbsubstreams.Module) string

Types

type Code

type Code struct {
	File       string `yaml:"file"`
	Type       string `yaml:"type"`
	Native     string `yaml:"native"`
	Content    []byte `yaml:"-"`
	Entrypoint string `yaml:"entrypoint"`
}

type Input

type Input struct {
	Source string `yaml:"source"`
	Store  string `yaml:"store"`
	Map    string `yaml:"map"`
	Mode   string `yaml:"mode"`

	Name string `yaml:"-"`
}

type Manifest

type Manifest struct {
	SpecVersion string    `yaml:"specVersion"`
	Description string    `yaml:"description"`
	ProtoFiles  []string  `yaml:"protoFiles"`
	Modules     []*Module `yaml:"modules"`

	Graph *ModuleGraph `yaml:"-"`
}

func DecodeYamlManifest

func DecodeYamlManifest(manifestContent string) (*Manifest, error)

func DecodeYamlManifestFromFile

func DecodeYamlManifestFromFile(yamlFilePath string) (string, *Manifest, error)

func New

func New(manifestFile string) (m *Manifest, err error)

func (*Manifest) PrintMermaid

func (m *Manifest) PrintMermaid()

func (*Manifest) ToProto

func (m *Manifest) ToProto() (*pbsubstreams.Manifest, error)

type Module

type Module struct {
	Name       string  `yaml:"name"`
	Kind       string  `yaml:"kind"`
	StartBlock *uint64 `yaml:"startBlock"`

	UpdatePolicy string       `yaml:"updatePolicy"`
	ValueType    string       `yaml:"valueType"`
	Code         Code         `yaml:"code"`
	Inputs       []*Input     `yaml:"inputs"`
	Output       StreamOutput `yaml:"output"`
}

func (*Module) String

func (m *Module) String() string

func (*Module) ToProtoNative

func (m *Module) ToProtoNative() (*pbsubstreams.Module, error)

func (*Module) ToProtoWASM

func (m *Module) ToProtoWASM(codeIndex uint32) (*pbsubstreams.Module, error)

type ModuleGraph

type ModuleGraph struct {
	*graph.Mutable
	// contains filtered or unexported fields
}

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) GetSources

func (g *ModuleGraph) GetSources() []string

func (*ModuleGraph) ModuleStartBlock

func (g *ModuleGraph) ModuleStartBlock(moduleName string) (uint64, error)

func (*ModuleGraph) ModulesDownTo

func (g *ModuleGraph) ModulesDownTo(moduleNames []string) ([]*pbsubstreams.Module, error)

func (*ModuleGraph) ParentsOf

func (g *ModuleGraph) ParentsOf(moduleName string) ([]*pbsubstreams.Module, error)

func (*ModuleGraph) StoresDownTo

func (g *ModuleGraph) StoresDownTo(moduleNames []string) ([]*pbsubstreams.Module, error)

func (*ModuleGraph) TopologicalSort

func (g *ModuleGraph) TopologicalSort() ([]*pbsubstreams.Module, bool)

type ModuleHash

type ModuleHash []byte

func HashModule

func HashModule(manifest *pbsubstreams.Manifest, module *pbsubstreams.Module, graph *ModuleGraph) ModuleHash

type ModuleMarshaler

type ModuleMarshaler []*pbsubstreams.Module

func (ModuleMarshaler) MarshalJSON

func (m ModuleMarshaler) MarshalJSON() ([]byte, error)

type StreamOutput

type StreamOutput struct {
	// For 'map'
	Type string `yaml:"type"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL