base

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResponseCode_name = map[int32]string{
		0:   "OK",
		400: "BAD_REQUEST",
		401: "Unauthorized",
		403: "FORBIDDEN",
		404: "NOT_FOUND",
		408: "TIMEOUT",
		500: "INTERNAL_ERROR",
	}
	ResponseCode_value = map[string]int32{
		"OK":             0,
		"BAD_REQUEST":    400,
		"Unauthorized":   401,
		"FORBIDDEN":      403,
		"NOT_FOUND":      404,
		"TIMEOUT":        408,
		"INTERNAL_ERROR": 500,
	}
)

Enum value maps for ResponseCode.

View Source
var File_base_base_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Request added in v0.2.0

type Request struct {

	// We will generate an id for this request if id in request is empty.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The timeout in milliseconds of request.
	// A value <= 0 is no timeout.
	TimeoutMillis int32 `protobuf:"varint,2,opt,name=timeout_millis,json=timeoutMillis,proto3" json:"timeout_millis,omitempty"`
	// contains filtered or unexported fields
}

The base request of services.

func (*Request) Descriptor deprecated added in v0.2.0

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetId added in v0.2.0

func (x *Request) GetId() string

func (*Request) GetTimeoutMillis added in v0.2.0

func (x *Request) GetTimeoutMillis() int32

func (*Request) ProtoMessage added in v0.2.0

func (*Request) ProtoMessage()

func (*Request) ProtoReflect added in v0.2.0

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

func (*Request) Reset added in v0.2.0

func (x *Request) Reset()

func (*Request) String added in v0.2.0

func (x *Request) String() string

type Response added in v0.2.0

type Response struct {

	// It will be the id in request if passed or an id generated by the service.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// The status code of this response.
	Code ResponseCode `protobuf:"varint,2,opt,name=code,proto3,enum=base.ResponseCode" json:"code,omitempty"`
	// The message of response.
	Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

The base response of services.

func (*Response) Descriptor deprecated added in v0.2.0

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetCode added in v0.2.0

func (x *Response) GetCode() ResponseCode

func (*Response) GetMsg added in v0.2.0

func (x *Response) GetMsg() string

func (*Response) GetRequestId added in v0.2.0

func (x *Response) GetRequestId() string

func (*Response) ProtoMessage added in v0.2.0

func (*Response) ProtoMessage()

func (*Response) ProtoReflect added in v0.2.0

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

func (*Response) Reset added in v0.2.0

func (x *Response) Reset()

func (*Response) String added in v0.2.0

func (x *Response) String() string

type ResponseCode added in v0.2.0

type ResponseCode int32

All response codes of avino-plan services.

const (
	ResponseCode_OK             ResponseCode = 0
	ResponseCode_BAD_REQUEST    ResponseCode = 400
	ResponseCode_Unauthorized   ResponseCode = 401
	ResponseCode_FORBIDDEN      ResponseCode = 403
	ResponseCode_NOT_FOUND      ResponseCode = 404
	ResponseCode_TIMEOUT        ResponseCode = 408
	ResponseCode_INTERNAL_ERROR ResponseCode = 500
)

func (ResponseCode) Descriptor added in v0.2.0

func (ResponseCode) Enum added in v0.2.0

func (x ResponseCode) Enum() *ResponseCode

func (ResponseCode) EnumDescriptor deprecated added in v0.2.0

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

Deprecated: Use ResponseCode.Descriptor instead.

func (ResponseCode) Number added in v0.2.0

func (ResponseCode) String added in v0.2.0

func (x ResponseCode) String() string

func (ResponseCode) Type added in v0.2.0

Jump to

Keyboard shortcuts

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