Documentation ¶
Index ¶
- Constants
- Variables
- func Compile(w io.Writer, msg Message, c ProtoCompiler) error
- func MessageToString(m Message) string
- func NewCompiler(endian binary.ByteOrder) *compiler
- func NewParser(endian binary.ByteOrder) *parser
- func NewVTPCompiler(comp Compiler) *vtpCompiler
- func NewVTPParser(parser Parser) *vtpParser
- func ParseStream(ctx context.Context, src io.Reader, parser ProtoParser, queue chan<- Message) error
- type AliasRequest
- type BlobRequest
- type BlobType
- type ByteType
- type Compiler
- type DocumentView
- type DropIndexRequest
- type DropIndexResponse
- type Head
- type HitsResponseRow
- type HitsSearchResponse
- type IndexRequest
- type ListAliasesRequest
- type ListAliasesResponse
- type ListAliasesResponseRow
- type ListIndicesRequest
- type ListIndicesResponse
- type Message
- type MessageType
- type MetaType
- type Parser
- type ProtoCompiler
- type ProtoParser
- type SearchRequest
- type SearchResponse
- type StatusResponse
- type StringType
- type Type
- type UInt32Type
- type UInt64Type
- type UnAliasRequest
Constants ¶
View Source
const (
Version = 0
)
Variables ¶
View Source
var (
UnknownMessageType = errors.New("unknown message type")
)
Functions ¶
func MessageToString ¶
func NewCompiler ¶
func NewVTPCompiler ¶
func NewVTPCompiler(comp Compiler) *vtpCompiler
func NewVTPParser ¶
func NewVTPParser(parser Parser) *vtpParser
func ParseStream ¶
Types ¶
type AliasRequest ¶
type AliasRequest struct { *Head Source *StringType Alias *StringType }
func NewAliasRequest ¶
func NewAliasRequest(id uint64, version uint8, index, alias string) *AliasRequest
func ParseAliasMessage ¶
type BlobRequest ¶
type ByteType ¶
type ByteType struct {
Value uint8
}
func MessageTypeToByte ¶
func MessageTypeToByte(m MessageType) *ByteType
type Compiler ¶
type Compiler interface { CompileUInt8(io.Writer, uint8) error CompileUInt32(io.Writer, uint32) error CompileUInt64(io.Writer, uint64) error CompileString(io.Writer, string) error CompileByteType(io.Writer, *ByteType) error CompileUInt32Type(io.Writer, *UInt32Type) error CompileUInt64Type(io.Writer, *UInt64Type) error CompileMessageType(io.Writer, MessageType) error CompileStringType(io.Writer, *StringType) error CompileVarcharType(io.Writer, *StringType) error CompileBlobType(io.Writer, *BlobType) error }
TODO: Split interface
type DocumentView ¶
type DocumentView struct { Name *StringType Content *StringType }
type DropIndexRequest ¶
type DropIndexRequest struct { *Head Index *StringType }
func NewDropIndexRequest ¶
func NewDropIndexRequest(id uint64, version uint8, index string) *DropIndexRequest
func ParseDropIndexRequest ¶
type DropIndexResponse ¶
type DropIndexResponse struct { *Head Ok *ByteType Index *StringType }
func NewDropIndexResponse ¶
func NewDropIndexResponse(id uint64, version uint8, ok bool, index string) *DropIndexResponse
func ParseDropIndexResponse ¶
func (*DropIndexResponse) IsOk ¶
func (d *DropIndexResponse) IsOk() bool
type Head ¶
type Head struct {
// contains filtered or unexported fields
}
func NewHeadResponse ¶
func (Head) Type ¶
func (h Head) Type() MessageType
type HitsResponseRow ¶
type HitsResponseRow struct { Document *DocumentView Hits *UInt32Type }
type HitsSearchResponse ¶
type HitsSearchResponse struct { *SearchResponse Documents []*HitsResponseRow }
func ParseHitsSearchResponse ¶
func ParseSearchResponse ¶
type IndexRequest ¶
type IndexRequest struct { *Head Format *ByteType // u8 Index *StringType // u8 Doc *StringType // u32 Text *StringType // u32 }
func NewIndexRequest ¶
func ParseIndexRequest ¶
type ListAliasesRequest ¶
type ListAliasesRequest struct {
*Head
}
func NewListAliasesRequest ¶
func NewListAliasesRequest(id uint64, version uint8) *ListAliasesRequest
func ParseListAliasesRequest ¶
func ParseListAliasesRequest(head *Head) (*ListAliasesRequest, error)
type ListAliasesResponse ¶
type ListAliasesResponse struct { *Head Aliases []*ListAliasesResponseRow }
func ParseListAliasesResponse ¶
func ParseListAliasesResponse(head *Head, src io.Reader, parser ProtoParser) (*ListAliasesResponse, error)
type ListAliasesResponseRow ¶
type ListAliasesResponseRow struct { Alias *StringType Indices []*StringType }
type ListIndicesRequest ¶
type ListIndicesRequest struct {
*Head
}
func NewListIndicesRequest ¶
func NewListIndicesRequest(id uint64, version uint8) *ListIndicesRequest
func ParseListIndicesRequest ¶
func ParseListIndicesRequest(head *Head) (*ListIndicesRequest, error)
type ListIndicesResponse ¶
type ListIndicesResponse struct { *Head Indices []*StringType }
type Message ¶
type Message interface { String() string Id() uint64 Version() uint8 Type() MessageType }
type MessageType ¶
type MessageType uint8
const ( StatusRes MessageType = iota + 1 AliasReq IndexReq SearchReq SearchRes RenameReq DropReq DropRes ListReq ListRes UnAliasReq ListAliasesReq ListAliasesRes )
func LookupResponseMessageType ¶
func LookupResponseMessageType(req MessageType) (MessageType, error)
type Parser ¶
type Parser interface { ParseUInt8(io.Reader) (uint8, error) ParseUInt32(io.Reader) (uint32, error) ParseUInt64(io.Reader) (uint64, error) ParseString(io.Reader) (string, error) ParseText(io.Reader) (string, error) ParseByteType(io.Reader) (*ByteType, error) ParseUInt32Type(io.Reader) (*UInt32Type, error) ParseUInt64Type(io.Reader) (*UInt64Type, error) ParseStringType(io.Reader) (*StringType, error) ParseTextType(io.Reader) (*StringType, error) ParseLongTextType(io.Reader) (*StringType, error) }
type ProtoCompiler ¶
type ProtoParser ¶
type SearchRequest ¶
type SearchRequest struct { *Head EngineType *ByteType Index *StringType Terms *StringType }
func NewSearchRequest ¶
func NewSearchRequest(id uint64, version, engine uint8, index, terms string) *SearchRequest
func ParseSearchRequest ¶
type SearchResponse ¶
type SearchResponse struct { *Head Engine *ByteType Documents []*StringType }
type StatusResponse ¶
func NewStatusResponse ¶
func NewStatusResponse(id uint64, version uint8, ok bool) *StatusResponse
func ParseStatusResponse ¶
type StringType ¶
type StringType struct {
Value string
}
func (StringType) Len ¶
func (sv StringType) Len() int
func (StringType) Type ¶
func (sv StringType) Type() MetaType
type UInt32Type ¶
type UInt32Type struct {
Value uint32
}
func (UInt32Type) Len ¶
func (u32 UInt32Type) Len() int
func (UInt32Type) Type ¶
func (u32 UInt32Type) Type() MetaType
type UInt64Type ¶
type UInt64Type struct {
Value uint64
}
func (UInt64Type) Len ¶
func (i UInt64Type) Len() int
func (UInt64Type) Type ¶
func (i UInt64Type) Type() MetaType
type UnAliasRequest ¶
type UnAliasRequest struct { *Head Index *StringType Alias *StringType }
func NewUnAliasRequest ¶
func NewUnAliasRequest(id uint64, version uint8, index, alias string) *UnAliasRequest
func ParseUnAliasMessage ¶
Click to show internal directories.
Click to hide internal directories.