errdetails

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package errdetails is a generated protocol buffer package.

It is generated from these files:

github.com/infobloxopen/atlas-app-toolkit/rpc/errdetails/error_details.proto

It has these top-level messages:

TargetInfo

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"`
}

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)

Jump to

Keyboard shortcuts

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