proto

package
v0.0.0-...-97e54d3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HashRequest_Type_name = map[int32]string{
		0: "UNKNOWN",
		1: "BODIES",
		2: "RECEIPTS",
	}
	HashRequest_Type_value = map[string]int32{
		"UNKNOWN":  0,
		"BODIES":   1,
		"RECEIPTS": 2,
	}
)

Enum value maps for HashRequest_Type.

View Source
var File_protocol_proto_v1_proto protoreflect.FileDescriptor
View Source
var V1_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.V1",
	HandlerType: (*V1Server)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetCurrent",
			Handler:    _V1_GetCurrent_Handler,
		},
		{
			MethodName: "GetObjectsByHash",
			Handler:    _V1_GetObjectsByHash_Handler,
		},
		{
			MethodName: "GetHeaders",
			Handler:    _V1_GetHeaders_Handler,
		},
		{
			MethodName: "Notify",
			Handler:    _V1_Notify_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "protocol/proto/v1.proto",
}

V1_ServiceDesc is the grpc.ServiceDesc for V1 service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterV1Server

func RegisterV1Server(s grpc.ServiceRegistrar, srv V1Server)

Types

type GetCurrentResponse

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

func (*GetCurrentResponse) Descriptor deprecated

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

Deprecated: Use GetCurrentResponse.ProtoReflect.Descriptor instead.

func (*GetCurrentResponse) ProtoMessage

func (*GetCurrentResponse) ProtoMessage()

func (*GetCurrentResponse) ProtoReflect

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

func (*GetCurrentResponse) Reset

func (x *GetCurrentResponse) Reset()

func (*GetCurrentResponse) String

func (x *GetCurrentResponse) String() string

type GetHeadersRequest

type GetHeadersRequest struct {

	// Provide a number or hash
	Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// Provide a number or hash
	Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	Skip int64  `protobuf:"varint,3,opt,name=skip,proto3" json:"skip,omitempty"`
	// Provide an amount not greater than 190
	Amount int64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*GetHeadersRequest) Descriptor deprecated

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

Deprecated: Use GetHeadersRequest.ProtoReflect.Descriptor instead.

func (*GetHeadersRequest) GetAmount

func (x *GetHeadersRequest) GetAmount() int64

func (*GetHeadersRequest) GetHash

func (x *GetHeadersRequest) GetHash() string

func (*GetHeadersRequest) GetNumber

func (x *GetHeadersRequest) GetNumber() int64

func (*GetHeadersRequest) GetSkip

func (x *GetHeadersRequest) GetSkip() int64

func (*GetHeadersRequest) ProtoMessage

func (*GetHeadersRequest) ProtoMessage()

func (*GetHeadersRequest) ProtoReflect

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

func (*GetHeadersRequest) Reset

func (x *GetHeadersRequest) Reset()

func (*GetHeadersRequest) String

func (x *GetHeadersRequest) String() string

type HashRequest

type HashRequest struct {
	Hash []string         `protobuf:"bytes,1,rep,name=hash,proto3" json:"hash,omitempty"`
	Type HashRequest_Type `protobuf:"varint,2,opt,name=type,proto3,enum=v1.HashRequest_Type" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*HashRequest) DecodeHashes

func (h *HashRequest) DecodeHashes() ([]types.Hash, error)

DecodeHashes decode to types Hash in the request

func (*HashRequest) Descriptor deprecated

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

Deprecated: Use HashRequest.ProtoReflect.Descriptor instead.

func (*HashRequest) GetHash

func (x *HashRequest) GetHash() []string

func (*HashRequest) GetType

func (x *HashRequest) GetType() HashRequest_Type

func (*HashRequest) ProtoMessage

func (*HashRequest) ProtoMessage()

func (*HashRequest) ProtoReflect

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

func (*HashRequest) Reset

func (x *HashRequest) Reset()

func (*HashRequest) String

func (x *HashRequest) String() string

type HashRequest_Type

type HashRequest_Type int32
const (
	HashRequest_UNKNOWN  HashRequest_Type = 0
	HashRequest_BODIES   HashRequest_Type = 1
	HashRequest_RECEIPTS HashRequest_Type = 2
)

func (HashRequest_Type) Descriptor

func (HashRequest_Type) Enum

func (HashRequest_Type) EnumDescriptor deprecated

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

Deprecated: Use HashRequest_Type.Descriptor instead.

func (HashRequest_Type) Number

func (HashRequest_Type) String

func (x HashRequest_Type) String() string

func (HashRequest_Type) Type

type NotifyReq

type NotifyReq struct {
	Status *V1Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Raw    *any.Any  `protobuf:"bytes,2,opt,name=raw,proto3" json:"raw,omitempty"`
	// contains filtered or unexported fields
}

func (*NotifyReq) Descriptor deprecated

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

Deprecated: Use NotifyReq.ProtoReflect.Descriptor instead.

func (*NotifyReq) GetRaw

func (x *NotifyReq) GetRaw() *any.Any

func (*NotifyReq) GetStatus

func (x *NotifyReq) GetStatus() *V1Status

func (*NotifyReq) ProtoMessage

func (*NotifyReq) ProtoMessage()

func (*NotifyReq) ProtoReflect

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

func (*NotifyReq) Reset

func (x *NotifyReq) Reset()

func (*NotifyReq) String

func (x *NotifyReq) String() string

type NumberRequest

type NumberRequest struct {
	Number []int64 `protobuf:"varint,1,rep,packed,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*NumberRequest) Descriptor deprecated

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

Deprecated: Use NumberRequest.ProtoReflect.Descriptor instead.

func (*NumberRequest) GetNumber

func (x *NumberRequest) GetNumber() []int64

func (*NumberRequest) ProtoMessage

func (*NumberRequest) ProtoMessage()

func (*NumberRequest) ProtoReflect

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

func (*NumberRequest) Reset

func (x *NumberRequest) Reset()

func (*NumberRequest) String

func (x *NumberRequest) String() string

type Response

type Response struct {
	Objs []*Response_Component `protobuf:"bytes,1,rep,name=objs,proto3" json:"objs,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetObjs

func (x *Response) GetObjs() []*Response_Component

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type Response_Component

type Response_Component struct {
	Spec *any.Any `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"`
	// contains filtered or unexported fields
}

func (*Response_Component) Descriptor deprecated

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

Deprecated: Use Response_Component.ProtoReflect.Descriptor instead.

func (*Response_Component) GetSpec

func (x *Response_Component) GetSpec() *any.Any

func (*Response_Component) ProtoMessage

func (*Response_Component) ProtoMessage()

func (*Response_Component) ProtoReflect

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

func (*Response_Component) Reset

func (x *Response_Component) Reset()

func (*Response_Component) String

func (x *Response_Component) String() string

type UnimplementedV1Server

type UnimplementedV1Server struct {
}

UnimplementedV1Server must be embedded to have forward compatible implementations.

func (UnimplementedV1Server) GetCurrent

func (UnimplementedV1Server) GetHeaders

func (UnimplementedV1Server) GetObjectsByHash

func (UnimplementedV1Server) Notify

type UnsafeV1Server

type UnsafeV1Server interface {
	// contains filtered or unexported methods
}

UnsafeV1Server may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to V1Server will result in compilation errors.

type V1Client

type V1Client interface {
	GetCurrent(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*V1Status, error)
	GetObjectsByHash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*Response, error)
	GetHeaders(ctx context.Context, in *GetHeadersRequest, opts ...grpc.CallOption) (*Response, error)
	Notify(ctx context.Context, in *NotifyReq, opts ...grpc.CallOption) (*empty.Empty, error)
}

V1Client is the client API for V1 service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewV1Client

func NewV1Client(cc grpc.ClientConnInterface) V1Client

type V1Server

type V1Server interface {
	GetCurrent(context.Context, *empty.Empty) (*V1Status, error)
	GetObjectsByHash(context.Context, *HashRequest) (*Response, error)
	GetHeaders(context.Context, *GetHeadersRequest) (*Response, error)
	Notify(context.Context, *NotifyReq) (*empty.Empty, error)
	// contains filtered or unexported methods
}

V1Server is the server API for V1 service. All implementations must embed UnimplementedV1Server for forward compatibility

type V1Status

type V1Status struct {
	Difficulty string `protobuf:"bytes,1,opt,name=difficulty,proto3" json:"difficulty,omitempty"`
	Hash       string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	Number     uint64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*V1Status) Descriptor deprecated

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

Deprecated: Use V1Status.ProtoReflect.Descriptor instead.

func (*V1Status) GetDifficulty

func (x *V1Status) GetDifficulty() string

func (*V1Status) GetHash

func (x *V1Status) GetHash() string

func (*V1Status) GetNumber

func (x *V1Status) GetNumber() uint64

func (*V1Status) ProtoMessage

func (*V1Status) ProtoMessage()

func (*V1Status) ProtoReflect

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

func (*V1Status) Reset

func (x *V1Status) Reset()

func (*V1Status) String

func (x *V1Status) String() string

Jump to

Keyboard shortcuts

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