request

package
v0.0.0-...-7b3ddb2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HighlightRequest

type HighlightRequest struct {
	PreTags           []string               `json:"pre_tags,omitempty"`
	PostTags          []string               `json:"post_tags,omitempty"`
	Fields            map[string]interface{} `json:"fields,omitempty"`
	RequireFieldMatch bool                   `json:"require_field_match,omitempty"`
	FragmentSize      int                    `json:"fragment_size,omitempty"`
	NumberOfFragments int                    `json:"number_of_fragments,omitempty"`
}

type ObjRequest

type ObjRequest struct {
	*RequestContext
	PartitionID entity.PartitionID `json:"partition,omitempty"`
	Value       []byte             `json:"value,omitempty"`
}

func NewObjRequest

func NewObjRequest(reqCtx *RequestContext, pid entity.PartitionID, value interface{}) (*ObjRequest, error)

func (*ObjRequest) Clone

func (req *ObjRequest) Clone(pid entity.PartitionID) Request

func (*ObjRequest) CloneValue

func (req *ObjRequest) CloneValue(pid entity.PartitionID, value interface{}) (Request, error)

func (*ObjRequest) Context

func (req *ObjRequest) Context() *RequestContext

func (*ObjRequest) Decode

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

this function will decoding or encoding value

func (*ObjRequest) GetPartitionID

func (req *ObjRequest) GetPartitionID() uint32

func (*ObjRequest) SetPartitionID

func (req *ObjRequest) SetPartitionID(pid entity.PartitionID)

type Request

type Request interface {
	Context() *RequestContext
	SetContext(ctx context.Context)
	GetPartitionID() entity.PartitionID
	SetPartitionID(entity.PartitionID)
}

type RequestContext

type RequestContext struct {
	MessageId    string `json:"message_id,omitempty"`
	Timeout      int64  `json:"timeout,omitempty"`
	PartitionNum int    `json:"partition_num,omitempty"`
	RouterAddr   string `json:"router_addr,omitempty"`
	Leader       bool   `json:"leader,omitempty"`
	// contains filtered or unexported fields
}

it use base struct must first field in structs

func (*RequestContext) AddCannelFunc

func (request *RequestContext) AddCannelFunc(cannel func())

func (*RequestContext) Cannel

func (request *RequestContext) Cannel()

func (*RequestContext) GetContext

func (request *RequestContext) GetContext() context.Context

func (*RequestContext) GetStore

func (request *RequestContext) GetStore() interface{}

func (*RequestContext) SetContext

func (request *RequestContext) SetContext(ctx context.Context)

func (*RequestContext) SetStore

func (request *RequestContext) SetStore(store interface{})

type SearchDocumentRequest

type SearchDocumentRequest struct {
	From         int               `json:"from,omitempty"`
	Size         *int              `json:"size,omitempty"`
	Fields       []string          `json:"fields,omitempty"`
	Query        json.RawMessage   `json:"query,omitempty"`
	Highlight    *HighlightRequest `json:"highlight,omitempty"`
	MinScore     float64           `json:"min_score,omitempty"`
	Sort         json.RawMessage   `json:"sort,omitempty"`
	Explain      bool              `json:"explain,omitempty"`
	Aggs         json.RawMessage   `json:"aggs,omitempty"`
	Aggregations json.RawMessage   `json:"aggregations,omitempty"` //it not use only for json un serizable
	ScriptFields json.RawMessage   `json:"script_fields,omitempty"`
	Quick        bool              `json:"quick,omitempty"`
	VectorValue  bool              `json:"vector_value,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchDocumentRequest) SortOrder

func (this *SearchDocumentRequest) SortOrder() (sortorder.SortOrder, error)

type SearchRequest

type SearchRequest struct {
	*RequestContext
	*SearchDocumentRequest
	DB          string             `json:"db,omitempty"`
	Space       string             `json:"space,omitempty"`
	PartitionID entity.PartitionID `json:"partition,omitempty"`
}

func NewSearchRequest

func NewSearchRequest(ctx context.Context, msgId string) *SearchRequest

func (*SearchRequest) Clone

func (req *SearchRequest) Clone(pid entity.PartitionID, db, space string) *SearchRequest

func (*SearchRequest) Context

func (req *SearchRequest) Context() *RequestContext

func (*SearchRequest) GetPartitionID

func (req *SearchRequest) GetPartitionID() uint32

func (*SearchRequest) SetPartitionID

func (req *SearchRequest) SetPartitionID(pid entity.PartitionID)

Jump to

Keyboard shortcuts

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