protoregistry

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

README

Protobuf Registry

The well-known Protobuf definitions are pulled from Buf Build Registry. This makes firehose-core able to decode some well-known block files directly.

Re-generate

To re-generate the well-known types, simply do:

go generate ./protoregistry

While being at the root of the project (if you run from this directory here, adjust ./protoregistry to .). Before re-generating, ensure you have push to Buf Registry the latest version of the definitions.

Add new well-known types

Push your definitions to the Buf Registry. Edit file ./generator/generator.go and add the Buf Registry path of the package in wellKnownProtoRepos variables.

Then re-generate Protobuf definitions and send a PR with the changes.

Documentation

Overview

Code generated by 'go run github.com/streamingfast/firehose-core/protoregistry/generator well_known.go protoregistry', DO NOT EDIT!

Index

Constants

This section is empty.

Variables

View Source
var WellKnownRegistry = NewEmpty()

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func New

func New(chainFileDescriptor protoreflect.FileDescriptor, protoPaths ...string) (*Registry, error)

New creates a new Registry first populated with the well-known types and then with the proto files passed as arguments. This means the precendence of the proto files is higher than the well-known types.

func NewEmpty added in v1.1.0

func NewEmpty() *Registry

func (*Registry) Extends

func (r *Registry) Extends(registry *Registry)

func (*Registry) RegisterFileDescriptor

func (r *Registry) RegisterFileDescriptor(f *desc.FileDescriptor)

func (*Registry) RegisterFiles

func (r *Registry) RegisterFiles(files []string) error

func (*Registry) Unmarshal added in v1.1.0

func (r *Registry) Unmarshal(t *anypb.Any) (*dynamic.Message, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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