Documentation ¶
Index ¶
Constants ¶
View Source
const CategoryBitOnErrorCode = 24
CategoryBitOnErrorCode is used to shift category on error code
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Category ¶
type Category uint8
Category is the category of dynamicgo modules
const ( // dynamicgo/json JSON Category = 0x01 // dynamicgo/thrift THRIFT Category = 0x02 // dynamicgo/conv/j2t JSON2THRIFT Category = 0x11 // dynamicgo/conv/t2j THRIFT2JSON Category = 0x12 // dynamicgo/proto PROTOBUF Category = 0x03 // dynamicgo/conv/j2p JSON2PROTOBUF Category = 0x13 // dynamicgo/conv/p2j PROTOBUF2JSON Category = 0x14 )
type Encoding ¶
type Encoding int
Encoding protocol enum
const ( // EncodingJSON is json protocol EncodingJSON Encoding = iota + 1 // EncodingThriftBinary is thrift binary protocol EncodingThriftBinary // EncodingThriftCompact is thrift compact protocol EncodingThriftCompact // EncodingProtobuf is protobuf protocol EncodingProtobuf // text encoding, see thrift/binary.go::EncodeText() EncodingText )
type ErrCode ¶
type ErrCode uint32
ErrCode is the error code of dynamicgo. Usually the left 8 bits are used to represent the category of error, and the right 24 bits are used to represent the behavior of error.
const ( // ErrUnsupportedType represents unsupported type error ErrUnsupportedType ErrCode = 1 + iota // ErrStackOverflow represents exceed stack limit error ErrStackOverflow // ErrRead represents read error ErrRead // ErrWrite represents write error ErrWrite // ErrDismatchType represents dismatch type error ErrDismatchType // ErrConvert represents convert error ErrConvert // ErrNotFound represents not found error ErrNotFound // ErrMissRequiredField represents missing required field error ErrMissRequiredField // ErrUnknownField represents unknown field error ErrUnknownField // ErrInvalidParam represents invalid parameter error ErrInvalidParam // ErrNotImplemented represents not implemented error ErrNotImplemented )
Error Behaviors
func NewErrorCode ¶
NewErrorCode created a new error code with category and behavior
type Error ¶
Error is the error concrete type of dynamicgo
type MapFieldWay ¶
type MapFieldWay uint8
MapFieldWay is the way to map an given key to field for struct descriptor
const ( // MapFieldUseAlias means use alias to map key to field MapFieldUseAlias MapFieldWay = iota // MapFieldUseFieldName means use field name to map key to field MapFieldUseFieldName // MapFieldUseBoth means use both alias and field name to map key to field MapFieldUseBoth )
type ParseFunctionMode ¶
type ParseFunctionMode int8
ParseFunctionMode indicates to parse only response or request for a IDL
const ( // ParseBoth indicates to parse both request and response for a IDL ParseBoth ParseFunctionMode = iota // ParseRequestOnly indicates to parse only request for a IDL ParseRequestOnly // ParseResponseOnly indicates to parse only response for a IDL ParseResponseOnly )
type ParseServiceMode ¶
type ParseServiceMode int8
ParseServiceMode .
const ( // LastServiceOnly forces the parser to parse only the last service definition. LastServiceOnly ParseServiceMode = iota // FirstServiceOnly forces the parser to parse only the first service definition. FirstServiceOnly // CombineServices forces the parser to combine methods of all service definitions. // Note that method names of the service definitions can not be duplicate. CombineServices )
Click to show internal directories.
Click to hide internal directories.