response

package
v3.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEngineErr

func NewEngineErr(err error) *pspb.EngineFailure

Types

type BulkItemResponse

type BulkItemResponse struct {
	OpType    pspb.OpType     `json:"-"`
	ItemValue *DocResultWrite `json:"-"`
}

func (*BulkItemResponse) HasError

func (this *BulkItemResponse) HasError() bool

func (*BulkItemResponse) KeyName

func (this *BulkItemResponse) KeyName() string

func (*BulkItemResponse) ToContent

func (this *BulkItemResponse) ToContent(idIsLong bool) ([]byte, error)

type BulkResponse

type BulkResponse struct {
	Took  uint64              `json:"took"`
	Items []*BulkItemResponse `json:"items"`
}

func (*BulkResponse) ToContent

func (sr *BulkResponse) ToContent(took int64, idIsLong bool) ([]byte, error)

type CostTime

type CostTime struct {
	ParamStartTime     time.Time `json:"param_start_time"`
	ParamEndTime       time.Time `json:"param_end_time"`
	GammaStartTime     time.Time `json:"gamma_start_time"`
	GammaEndTime       time.Time `json:"gamma_end_time"`
	DocSStartTime      time.Time `json:"merge_start_time"`
	DocSEndTime        time.Time `json:"merge_end_time"`
	ClientPsPStartTime time.Time `json:"clientpsp_start_time"`
	ClientPsPEndTime   time.Time `json:"clientpsp_end_time"`
	PsHandlerStartTime time.Time `json:"pshandler_start_time"`
	PsHandlerEndTime   time.Time `json:"pshandler_end_time"`
	PsSWStartTime      time.Time `json:"pssw_start_time"`
	PsSWEndTime        time.Time `json:"pssw_end_time"`
}

type DocResult

type DocResult struct {
	Id         string               `json:"id,omitempty"`
	DB         entity.DBID          `json:"db"`
	Space      entity.SpaceID       `json:"space"`
	Partition  entity.PartitionID   `json:"pid"`
	Version    int64                `json:"version,omitempty"`
	Found      bool                 `json:"found,omitempty"`
	Replace    bool                 `json:"replace,omitempty"`
	Score      float64              `json:"score,omitempty"`
	SortValues sortorder.SortValues `json:"sort_value,omitempty"`
	SlotID     uint32               `json:"slot_id"`
	Source     json.RawMessage      `json:"source,omitempty"`
	Extra      json.RawMessage      `json:"extra,omitempty"`
	Failure    *pspb.EngineFailure  `json:"failure,omitempty"`
	Type       pspb.OpType          `json:"type"`
	Highlight  HighlightResult      `json:"highlight,omitempty"`
	CostTime   *CostTime            `json:"costtime,omitempty"`
}

func NewErrDocResult

func NewErrDocResult(id string, err error) *DocResult

func NewErrDocResults

func NewErrDocResults(ids []string, err error) []*DocResult

func NewNotFoundDocResult

func NewNotFoundDocResult(id string) *DocResult

func TestResult

func TestResult() *DocResult

TODO to delete it

func (*DocResult) ToContent

func (this *DocResult) ToContent(dbName, spaceName string, idIsLong bool) ([]byte, error)

type DocResultWrite

type DocResultWrite struct {
	DocResult  *DocResult
	DbName     string
	SpaceName  string
	ReplicaNum int
}

func (*DocResultWrite) SuccessStatus

func (doc *DocResultWrite) SuccessStatus() int

func (*DocResultWrite) ToContent

func (this *DocResultWrite) ToContent(idIsLong bool) ([]byte, error)

func (*DocResultWrite) WriteResult

func (doc *DocResultWrite) WriteResult() string

type DocResults

type DocResults []*DocResult

func (*DocResults) ToContent

func (this *DocResults) ToContent(dbName, spaceName string, idIsLong bool) ([]byte, error)

type DocStreamResult

type DocStreamResult struct {
	Count int
	// contains filtered or unexported fields
}

func NewDocStreamResult

func NewDocStreamResult(ctx context.Context) *DocStreamResult

func (*DocStreamResult) AddDoc

func (sdr *DocStreamResult) AddDoc(result *DocResult)

func (*DocStreamResult) AddErr

func (sdr *DocStreamResult) AddErr(e error)

func (*DocStreamResult) Close

func (sdr *DocStreamResult) Close()

func (*DocStreamResult) Next

func (sdr *DocStreamResult) Next() (*DocResult, error)

type HighlightResult

type HighlightResult map[string][]string

type Hits

type Hits []*DocResult

func (Hits) Merge

func (dh Hits) Merge(spid, fpid uint32, sh Hits, so sort.SortOrder, from, size int) Hits

func (Hits) ToContent

func (dh Hits) ToContent(nameCache NameCache, from, size int, idIsLong bool) ([]byte, error)

type IndexErrMap

type IndexErrMap map[string]error

IndexErrMap tracks errors with the name of the index where it occurred

type NameCache

type NameCache map[[2]int64][]string

type ObjResponse

type ObjResponse struct {
	Value []byte `json:"value,omitempty"`
}

func NewObjResponse

func NewObjResponse(value interface{}) (*ObjResponse, error)

func (*ObjResponse) Decode

func (req *ObjResponse) Decode(i interface{}) error

this function will decoding or encoding value

type Response

type Response struct {
	Resp   interface{}
	Status int64
	Err    error
}

type Responses

type Responses []*Response

type SearchResponse

type SearchResponse struct {
	PID         uint32                    `json:"-"`
	Timeout     bool                      `json:"time_out"`
	Status      *SearchStatus             `json:"status"`
	Hits        Hits                      `json:"hits"`
	Total       uint64                    `json:"total_hits"`
	MaxScore    float64                   `json:"max_score"`
	MaxTook     int64                     `json:"took"`
	MaxTookID   uint32                    `json:"max_took_id"`
	Explain     map[uint32]string         `json:"explain,omitempty"`
	ByteArr     []byte                    `json:"byte_arr"`
	Start       time.Time                 `json:"start_time"`
	FieldType   map[string]pspb.FieldType `json:"index_mapping"`
	DBID        int64                     `json:"db_id"`
	SpaceID     int64                     `json:"space_id"`
	PartitionID uint32                    `json:"partition_id"`
	ArrayBool   bool                      `json:"array_bool"`
}

func NewSearchResponseErr

func NewSearchResponseErr(err error) *SearchResponse

func (*SearchResponse) Merge

func (sr *SearchResponse) Merge(other *SearchResponse, so sort.SortOrder, from, size int) (err error)

Merge will merge together multiple SearchResults during a MultiSearch, two args :[sortOrder, size]

func (*SearchResponse) ToContent

func (sr *SearchResponse) ToContent(from, size int, nameCache NameCache, typedKeys bool, took time.Duration, idIsLong bool) ([]byte, error)

type SearchResponses

type SearchResponses []*SearchResponse

func (SearchResponses) ToContent

func (srs SearchResponses) ToContent(from, size int, nameCache NameCache, typedKeys bool, took time.Duration, idIsLong bool) ([]byte, error)

func (SearchResponses) ToContentIds

func (srs SearchResponses) ToContentIds(from, size int, nameCache NameCache, took time.Duration, idIsLong bool) ([]byte, error)

func (SearchResponses) ToIDContent

func (srs SearchResponses) ToIDContent() []byte

type SearchStatus

type SearchStatus struct {
	Total      int         `json:"total"`
	Failed     int         `json:"failed"`
	Successful int         `json:"successful"`
	Errors     IndexErrMap `json:"errors,omitempty"`
}

func (*SearchStatus) Merge

func (ss *SearchStatus) Merge(other *SearchStatus)

Merge will merge together multiple SearchStatuses during a MultiSearch

type Shards

type Shards struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Failed     int `json:"failed"`
}

func (*Shards) ToContent

func (sr *Shards) ToContent() ([]byte, error)

type WriteError

type WriteError struct {
	ErrorIndex     string `json:"index"`
	ErrorIndexUUID string `json:"index_uuid"`
	Shard          string `json:"shard"`
	ErrorType      string `json:"type"`
	ErrorReason    string `json:"reason"`
}

type WriteResponse

type WriteResponse []*DocResult

func (WriteResponse) Merge

func (this WriteResponse) Merge(src WriteResponse)

func (*WriteResponse) ToContent

func (this *WriteResponse) ToContent(dbName, spaceName string, idIsLong bool) ([]byte, error)

func (*WriteResponse) ToContentBluk

func (this *WriteResponse) ToContentBluk(nameCache NameCache, idIsLong bool) ([]byte, error)

Jump to

Keyboard shortcuts

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