contract

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternal = &Error{Code: ErrorCode_INTERNAL, Text: "Internal server error"}
	ErrNotFound = &Error{Code: ErrorCode_NOT_FOUND, Text: "Not found"}
)
View Source
var (
	ErrorCode_name = map[int32]string{
		0: "UNKNOWN",
		1: "INTERNAL",
		2: "NOT_FOUND",
	}
	ErrorCode_value = map[string]int32{
		"UNKNOWN":   0,
		"INTERNAL":  1,
		"NOT_FOUND": 2,
	}
)

Enum value maps for ErrorCode.

View Source
var File_contract_replication_proto protoreflect.FileDescriptor

Functions

func RespondError

func RespondError(e *Error) []byte

Types

type Error

type Error struct {
	Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=schema.v1.ErrorCode" json:"code,omitempty"`
	Text string    `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetCode

func (x *Error) GetCode() ErrorCode

func (*Error) GetText

func (x *Error) GetText() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type ErrorCode

type ErrorCode int32
const (
	ErrorCode_UNKNOWN   ErrorCode = 0
	ErrorCode_INTERNAL  ErrorCode = 1
	ErrorCode_NOT_FOUND ErrorCode = 2
)

func (ErrorCode) Descriptor

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor

func (ErrorCode) Enum

func (x ErrorCode) Enum() *ErrorCode

func (ErrorCode) EnumDescriptor deprecated

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

Deprecated: Use ErrorCode.Descriptor instead.

func (ErrorCode) Number

func (x ErrorCode) Number() protoreflect.EnumNumber

func (ErrorCode) String

func (x ErrorCode) String() string

func (ErrorCode) Type

type NextSegmentRequest

type NextSegmentRequest struct {
	RequestId       string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	LastSegmentName string `protobuf:"bytes,2,opt,name=last_segment_name,json=lastSegmentName,proto3" json:"last_segment_name,omitempty"`
	// contains filtered or unexported fields
}

func (*NextSegmentRequest) Descriptor deprecated

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

Deprecated: Use NextSegmentRequest.ProtoReflect.Descriptor instead.

func (*NextSegmentRequest) GetLastSegmentName

func (x *NextSegmentRequest) GetLastSegmentName() string

func (*NextSegmentRequest) GetRequestId

func (x *NextSegmentRequest) GetRequestId() string

func (*NextSegmentRequest) ProtoMessage

func (*NextSegmentRequest) ProtoMessage()

func (*NextSegmentRequest) ProtoReflect

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

func (*NextSegmentRequest) Reset

func (x *NextSegmentRequest) Reset()

func (*NextSegmentRequest) String

func (x *NextSegmentRequest) String() string

type NextSegmentResponse

type NextSegmentResponse struct {
	Error       *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	SegmentName string `protobuf:"bytes,2,opt,name=segment_name,json=segmentName,proto3" json:"segment_name,omitempty"`
	Data        []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*NextSegmentResponse) Descriptor deprecated

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

Deprecated: Use NextSegmentResponse.ProtoReflect.Descriptor instead.

func (*NextSegmentResponse) GetData

func (x *NextSegmentResponse) GetData() []byte

func (*NextSegmentResponse) GetError

func (x *NextSegmentResponse) GetError() *Error

func (*NextSegmentResponse) GetSegmentName

func (x *NextSegmentResponse) GetSegmentName() string

func (*NextSegmentResponse) ProtoMessage

func (*NextSegmentResponse) ProtoMessage()

func (*NextSegmentResponse) ProtoReflect

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

func (*NextSegmentResponse) Reset

func (x *NextSegmentResponse) Reset()

func (*NextSegmentResponse) String

func (x *NextSegmentResponse) String() string

Jump to

Keyboard shortcuts

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