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 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.