cosmos_proto

package module
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 2,310

README

Pulsar

Installing

go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar

Running

cd path/to/proto/files

protoc --go-pulsar_out=. --go-pulsar_opt=paths=source_relative --go-pulsar_opt=features=protoc+fast -I . NAME_OF_FILE.proto

Acknowledgements

Code for the generator structure/features and the functions marshal, unmarshal, and size implemented by planetscale/vtprotobuf was used in our ProtoMethods implementation.

Code used to produce default code stubs found in protobuf was copied into features/protoc.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ScalarType_name = map[int32]string{
		0: "SCALAR_TYPE_UNSPECIFIED",
		1: "SCALAR_TYPE_STRING",
		2: "SCALAR_TYPE_BYTES",
	}
	ScalarType_value = map[string]int32{
		"SCALAR_TYPE_UNSPECIFIED": 0,
		"SCALAR_TYPE_STRING":      1,
		"SCALAR_TYPE_BYTES":       2,
	}
)

Enum value maps for ScalarType.

View Source
var (
	// implements_interface is used to indicate the type name of the interface
	// that a message implements so that it can be used in google.protobuf.Any
	// fields that accept that interface. A message can implement multiple
	// interfaces. Interfaces should be declared using a declare_interface
	// file option.
	//
	// repeated string implements_interface = 93001;
	E_ImplementsInterface = &file_cosmos_proto_cosmos_proto_extTypes[1]
	// message_added_in is used to indicate from which version the message was added.
	//
	// optional string message_added_in = 93002;
	E_MessageAddedIn = &file_cosmos_proto_cosmos_proto_extTypes[2]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	// accepts_interface is used to annotate that a google.protobuf.Any
	// field accepts messages that implement the specified interface.
	// Interfaces should be declared using a declare_interface file option.
	//
	// optional string accepts_interface = 93001;
	E_AcceptsInterface = &file_cosmos_proto_cosmos_proto_extTypes[3]
	// scalar is used to indicate that this field follows the formatting defined
	// by the named scalar which should be declared with declare_scalar. Code
	// generators may choose to use this information to map this field to a
	// language-specific type representing the scalar.
	//
	// optional string scalar = 93002;
	E_Scalar = &file_cosmos_proto_cosmos_proto_extTypes[4]
	// field_added_in is used to indicate from which version the field was added.
	//
	// optional string field_added_in = 93003;
	E_FieldAddedIn = &file_cosmos_proto_cosmos_proto_extTypes[5]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// declare_interface declares an interface type to be used with
	// accepts_interface and implements_interface. Interface names are
	// expected to follow the following convention such that their declaration
	// can be discovered by tools: for a given interface type a.b.C, it is
	// expected that the declaration will be found in a protobuf file named
	// a/b/interfaces.proto in the file descriptor set.
	//
	// repeated cosmos_proto.InterfaceDescriptor declare_interface = 793021;
	E_DeclareInterface = &file_cosmos_proto_cosmos_proto_extTypes[6]
	// declare_scalar declares a scalar type to be used with
	// the scalar field option. Scalar names are
	// expected to follow the following convention such that their declaration
	// can be discovered by tools: for a given scalar type a.b.C, it is
	// expected that the declaration will be found in a protobuf file named
	// a/b/scalars.proto in the file descriptor set.
	//
	// repeated cosmos_proto.ScalarDescriptor declare_scalar = 793022;
	E_DeclareScalar = &file_cosmos_proto_cosmos_proto_extTypes[7]
	// file_added_in is used to indicate from which the version the file was added.
	//
	// optional string file_added_in = 793023;
	E_FileAddedIn = &file_cosmos_proto_cosmos_proto_extTypes[8]
)

Extension fields to descriptorpb.FileOptions.

View Source
var (
	// method_added_in is used to indicate from which version the method was added.
	//
	// optional string method_added_in = 93001;
	E_MethodAddedIn = &file_cosmos_proto_cosmos_proto_extTypes[0]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var File_cosmos_proto_cosmos_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type InterfaceDescriptor

type InterfaceDescriptor struct {

	// name is the name of the interface. It should be a short-name (without
	// a period) such that the fully qualified name of the interface will be
	// package.name, ex. for the package a.b and interface named C, the
	// fully-qualified name will be a.b.C.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// description is a human-readable description of the interface and its
	// purpose.
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

InterfaceDescriptor describes an interface type to be used with accepts_interface and implements_interface and declared by declare_interface.

func (*InterfaceDescriptor) Descriptor deprecated

func (*InterfaceDescriptor) Descriptor() ([]byte, []int)

Deprecated: Use InterfaceDescriptor.ProtoReflect.Descriptor instead.

func (*InterfaceDescriptor) GetDescription

func (x *InterfaceDescriptor) GetDescription() string

func (*InterfaceDescriptor) GetName

func (x *InterfaceDescriptor) GetName() string

func (*InterfaceDescriptor) ProtoMessage

func (*InterfaceDescriptor) ProtoMessage()

func (*InterfaceDescriptor) ProtoReflect

func (x *InterfaceDescriptor) ProtoReflect() protoreflect.Message

func (*InterfaceDescriptor) Reset

func (x *InterfaceDescriptor) Reset()

func (*InterfaceDescriptor) String

func (x *InterfaceDescriptor) String() string

type ScalarDescriptor

type ScalarDescriptor struct {

	// name is the name of the scalar. It should be a short-name (without
	// a period) such that the fully qualified name of the scalar will be
	// package.name, ex. for the package a.b and scalar named C, the
	// fully-qualified name will be a.b.C.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// description is a human-readable description of the scalar and its
	// encoding format. For instance a big integer or decimal scalar should
	// specify precisely the expected encoding format.
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// field_type is the type of field with which this scalar can be used.
	// Scalars can be used with one and only one type of field so that
	// encoding standards and simple and clear. Currently only string and
	// bytes fields are supported for scalars.
	FieldType []ScalarType `protobuf:"varint,3,rep,packed,name=field_type,json=fieldType,proto3,enum=cosmos_proto.ScalarType" json:"field_type,omitempty"`
	// contains filtered or unexported fields
}

ScalarDescriptor describes an scalar type to be used with the scalar field option and declared by declare_scalar. Scalars extend simple protobuf built-in types with additional syntax and semantics, for instance to represent big integers. Scalars should ideally define an encoding such that there is only one valid syntactical representation for a given semantic meaning, i.e. the encoding should be deterministic.

func (*ScalarDescriptor) Descriptor deprecated

func (*ScalarDescriptor) Descriptor() ([]byte, []int)

Deprecated: Use ScalarDescriptor.ProtoReflect.Descriptor instead.

func (*ScalarDescriptor) GetDescription

func (x *ScalarDescriptor) GetDescription() string

func (*ScalarDescriptor) GetFieldType

func (x *ScalarDescriptor) GetFieldType() []ScalarType

func (*ScalarDescriptor) GetName

func (x *ScalarDescriptor) GetName() string

func (*ScalarDescriptor) ProtoMessage

func (*ScalarDescriptor) ProtoMessage()

func (*ScalarDescriptor) ProtoReflect

func (x *ScalarDescriptor) ProtoReflect() protoreflect.Message

func (*ScalarDescriptor) Reset

func (x *ScalarDescriptor) Reset()

func (*ScalarDescriptor) String

func (x *ScalarDescriptor) String() string

type ScalarType

type ScalarType int32
const (
	ScalarType_SCALAR_TYPE_UNSPECIFIED ScalarType = 0
	ScalarType_SCALAR_TYPE_STRING      ScalarType = 1
	ScalarType_SCALAR_TYPE_BYTES       ScalarType = 2
)

func (ScalarType) Descriptor

func (ScalarType) Descriptor() protoreflect.EnumDescriptor

func (ScalarType) Enum

func (x ScalarType) Enum() *ScalarType

func (ScalarType) EnumDescriptor deprecated

func (ScalarType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ScalarType.Descriptor instead.

func (ScalarType) Number

func (x ScalarType) Number() protoreflect.EnumNumber

func (ScalarType) String

func (x ScalarType) String() string

func (ScalarType) Type

Directories

Path Synopsis
package any deprecated: use anyutil package instead
package any deprecated: use anyutil package instead
Package any is a helper library to be used as a replacement for some of the official "google.golang.org/protobuf/types/known/anypb"'s functions which prepend the "type.googleapis.com" prefix in type URLs.
Package any is a helper library to be used as a replacement for some of the official "google.golang.org/protobuf/types/known/anypb"'s functions which prepend the "type.googleapis.com" prefix in type URLs.
cmd
features
protoc
Package protoc is used to generate protoc-gen-go files
Package protoc is used to generate protoc-gen-go files
protoc/genid
Package genid contains constants for declarations in descriptor.proto and the well-known types.
Package genid contains constants for declarations in descriptor.proto and the well-known types.
protoc/version
Package version records versioning information about this module.
Package version records versioning information about this module.
internal
testprotos/test3
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.
support
timepb
Package timepb provides functions to do time operations with protobuf timestamp and duration structures.
Package timepb provides functions to do time operations with protobuf timestamp and duration structures.
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.

Jump to

Keyboard shortcuts

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