errdetails

package
v0.0.0-...-9c7b1c4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TargetInfo

type TargetInfo struct {
	// The status code is an enumerated error code,
	// which should be an enum value of [google.rpc.Code][google.rpc.Code]
	Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
	// The message is a human-readable non-localized message
	Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
	// The target is a resource name
	Target               string   `protobuf:"bytes,3,opt,name=target" json:"target,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TargetInfo is a default representation of error details that conforms REST API Syntax Specification

func New

func New(c codes.Code, target string, msg string) *TargetInfo

New returns a TargetInfo representing c, target and msg. Converts provided Code to int32

func Newf

func Newf(c codes.Code, target string, format string, a ...interface{}) *TargetInfo

NewfTargetInfo returns NewTargetInfo(c, fmt.Sprintf(format, a...)).

func (*TargetInfo) Descriptor

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

func (*TargetInfo) GetCode

func (m *TargetInfo) GetCode() int32

func (*TargetInfo) GetMessage

func (m *TargetInfo) GetMessage() string

func (*TargetInfo) GetTarget

func (m *TargetInfo) GetTarget() string

func (*TargetInfo) MarshalJSON

func (ti *TargetInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. TargetInfo.Code field is marshaled into string with corresponding value, see [google.rpc.Code][google.rpc.Code], if code is the codes.Unimplemented it is marshaled as "NOT_IMPLEMENTED" string.

func (*TargetInfo) ProtoMessage

func (*TargetInfo) ProtoMessage()

func (*TargetInfo) Reset

func (m *TargetInfo) Reset()

func (*TargetInfo) String

func (m *TargetInfo) String() string

func (*TargetInfo) UnmarshalJSON

func (ti *TargetInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. If "code" is not provided in JSON data or is null, the TargetInfo.Code will be set to 0 (OK)

func (*TargetInfo) XXX_DiscardUnknown

func (m *TargetInfo) XXX_DiscardUnknown()

func (*TargetInfo) XXX_Marshal

func (m *TargetInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TargetInfo) XXX_Merge

func (dst *TargetInfo) XXX_Merge(src proto.Message)

func (*TargetInfo) XXX_Size

func (m *TargetInfo) XXX_Size() int

func (*TargetInfo) XXX_Unmarshal

func (m *TargetInfo) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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