Documentation ¶
Index ¶
- Constants
- Variables
- func ParseErrorReply(line []byte) error
- type Reader
- func (r *Reader) Buffered() int
- func (r *Reader) Peek(n int) ([]byte, error)
- func (r *Reader) PeekReplyType() (byte, error)
- func (r *Reader) ReadArrayLen() (int, error)
- func (r *Reader) ReadBytes() ([]byte, error)
- func (r *Reader) ReadFloat() (float32, error)
- func (r *Reader) ReadInt() (int64, error)
- func (r *Reader) ReadLine() ([]byte, error)
- func (r *Reader) ReadMetaFrame() (int, error)
- func (r *Reader) ReadReply() (interface{}, error)
- func (r *Reader) ReadSlice() ([]interface{}, error)
- func (r *Reader) ReadStatus() (int64, error)
- func (r *Reader) ReadString() (string, error)
- func (r *Reader) Reset(rd io.Reader)
- type SkytableError
- type Writer
Constants ¶
View Source
const ( RespString = '+' // +<length>\n<bytes>\n RespArray = '&' // &<c>\n<elements> RespAnyArray = '~' // ~<c>\n<elements> RespFlatArray = '_' // _<c>\n<elements> RespTypedArray = '@' // @<c>\n<elements> RespTypedNonNullArray = '^' // ^<c>\n<elements> RespInt = ':' // :<length>\n<number> RespFloat = '%' // %<length>\n<bytes>\n RespBlob = '?' // ?<length>\n<bytes> RespStatus = '!' // !<length>\n<statusCode>\n RespMetaFrame = '*' // *<number>\n )
View Source
const ActionError = SkytableError("skytable: action error")
View Source
const AuthnRealmError = SkytableError("skytable: authn realm error")
View Source
const BadCredentials = SkytableError("skytable: bad credentials")
View Source
const EncodingError = SkytableError("skytable: encoding error")
View Source
const Nil = SkytableError("skytable: nil")
View Source
const OtherError = SkytableError("skytable: other error")
View Source
const OverwriteError = SkytableError("skytable: overwrite error")
View Source
const PacketError = SkytableError("skytable: packet error")
View Source
const ServerError = SkytableError("skytable: server error")
View Source
const UnknownDataTypeError = SkytableError("skytable: unknown data type")
View Source
const WrongTypeError = SkytableError("skytable: wrong type error")
Variables ¶
View Source
var CodeToErrorMap = map[int64]SkytableError{ 1: Nil, 2: OverwriteError, 3: ActionError, 4: PacketError, 5: ServerError, 6: OtherError, 7: WrongTypeError, 8: UnknownDataTypeError, 9: EncodingError, 10: BadCredentials, 11: AuthnRealmError, }
Functions ¶
func ParseErrorReply ¶
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) PeekReplyType ¶
PeekReplyType returns the data type of the next response without advancing the Reader, and discard the attribute type.
func (*Reader) ReadArrayLen ¶
func (*Reader) ReadLine ¶
ReadLine Return a valid reply, it will check the protocol or skytable error, and discard the attribute type.
func (*Reader) ReadMetaFrame ¶
func (*Reader) ReadStatus ¶
func (*Reader) ReadString ¶
type SkytableError ¶
type SkytableError string
func (SkytableError) Error ¶
func (e SkytableError) Error() string
func (SkytableError) SkytableError ¶
func (SkytableError) SkytableError()
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) WriteMetaFrame ¶
Click to show internal directories.
Click to hide internal directories.