api

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorCode_name = map[int32]string{
		500: "internal_server_error",
		301: "moved_permanently",
		302: "found",
		400: "bad_request",
		401: "not_authorized",
		403: "forbidden",
		404: "not_found",
	}
	ErrorCode_value = map[string]int32{
		"internal_server_error": 500,
		"moved_permanently":     301,
		"found":                 302,
		"bad_request":           400,
		"not_authorized":        401,
		"forbidden":             403,
		"not_found":             404,
	}
)

Enum value maps for ErrorCode.

View Source
var File_router_proto_api_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Error

type Error struct {
	Code   *int32     `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
	Title  *ErrorCode `protobuf:"varint,2,opt,name=title,enum=nagax.router.api.ErrorCode" json:"title,omitempty"` // corresponds to code, e.g. not_found, internal_server_error
	Detail *string    `protobuf:"bytes,3,opt,name=detail" json:"detail,omitempty"`                                // optional long message
	// contains filtered or unexported fields
}

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() int32

func (*Error) GetDetail

func (x *Error) GetDetail() string

func (*Error) GetTitle

func (x *Error) GetTitle() ErrorCode

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_internal_server_error ErrorCode = 500
	ErrorCode_moved_permanently     ErrorCode = 301
	ErrorCode_found                 ErrorCode = 302
	ErrorCode_bad_request           ErrorCode = 400
	ErrorCode_not_authorized        ErrorCode = 401
	ErrorCode_forbidden             ErrorCode = 403
	ErrorCode_not_found             ErrorCode = 404
)

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

func (*ErrorCode) UnmarshalJSON deprecated

func (x *ErrorCode) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type ErrorResponse

type ErrorResponse struct {
	Errors []*Error `protobuf:"bytes,1,rep,name=errors" json:"errors,omitempty"`
	// contains filtered or unexported fields
}

func (*ErrorResponse) Descriptor deprecated

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

Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.

func (*ErrorResponse) GetErrors

func (x *ErrorResponse) GetErrors() []*Error

func (*ErrorResponse) ProtoMessage

func (*ErrorResponse) ProtoMessage()

func (*ErrorResponse) ProtoReflect

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

func (*ErrorResponse) Reset

func (x *ErrorResponse) Reset()

func (*ErrorResponse) String

func (x *ErrorResponse) String() string

Jump to

Keyboard shortcuts

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