Documentation ¶
Index ¶
- Constants
- Variables
- func CheckLimiter(ctx context.Context, req interface{}, pxy types.ProxyComponent) (any, error)
- func GetAuthorization(c *gin.Context) string
- func HTTPAbortReturn(c *gin.Context, code int, result gin.H)
- func HTTPReturn(c *gin.Context, code int, result gin.H)
- func HTTPReturnStream(c *gin.Context, code int, result gin.H)
- func LoggerHandlerFunc() gin.HandlerFunc
- func MetricsHandlerFunc(c *gin.Context)
- func ParseUsernamePassword(c *gin.Context) (string, string, bool)
- func RequestHandlerFunc(c *gin.Context)
- func WrapErrorToResponse(err error) *milvuspb.BoolResponse
- type AliasCollectionReq
- type AliasNameGetter
- type AliasReq
- type BaseGetter
- type BufferPool
- type CollectionDataReq
- type CollectionFieldReqWithParams
- type CollectionFilterReq
- type CollectionIDReq
- type CollectionNameReq
- type CollectionReq
- type CollectionReqWithProperties
- type CollectionSchema
- type CreateCollectionReq
- type DatabaseReq
- type DatabaseReqRequiredName
- type DatabaseReqWithProperties
- type DeleteReq
- type DropCollectionPropertiesReq
- type DropCollectionReq
- type DropIndexPropertiesReq
- type EmptyReq
- type ErrResponse
- type FieldData
- type FieldSchema
- type FilesGetter
- type FunctionSchema
- type GetReq
- type GrantReq
- type GrantV2Req
- type Handlers
- type HandlersV1
- type HandlersV2
- type HybridSearchReq
- type ImportReq
- type IndexNameGetter
- type IndexParam
- type IndexParamReq
- type IndexReq
- type IndexReqWithProperties
- type InsertReq
- type JobIDGetter
- type JobIDReq
- type NewPasswordReq
- type OptionalCollectionNameReq
- type OptionsGetter
- type PartitionReq
- type PartitionsReq
- type PasswordReq
- type PrivilegeGroupReq
- type QueryReq
- type QueryReqV2
- type Rand
- type RenameCollectionReq
- type ResourceGroupConfig
- func (req *ResourceGroupConfig) GetLimits() *ResourceGroupLimit
- func (req *ResourceGroupConfig) GetNodeFilter() *ResourceGroupNodeFilter
- func (req *ResourceGroupConfig) GetRequests() *ResourceGroupLimit
- func (req *ResourceGroupConfig) GetTransferFrom() []*ResourceGroupTransfer
- func (req *ResourceGroupConfig) GetTransferTo() []*ResourceGroupTransfer
- type ResourceGroupLimit
- type ResourceGroupNodeFilter
- type ResourceGroupReq
- type ResourceGroupTransfer
- type RestRequestInterceptor
- type ReturnErrMsg
- type RoleNameGetter
- type RoleReq
- type SearchReq
- type SearchReqV2
- type SearchRequest
- type SingleInsertReq
- type SingleUpsertReq
- type SubSearchReq
- type Timeout
- type TransferReplicaReq
- type UpdateResourceGroupReq
- type UpsertReq
- type UserNameGetter
- type UserReq
- type UserRoleReq
- type VectorIDs
- type VectorsArray
- type WrappedCalcDistanceRequest
- type WrappedCreateCollectionRequest
- type WrappedInsertRequest
- type Writer
Constants ¶
const ( // --- category --- DataBaseCategory = "/databases/" CollectionCategory = "/collections/" EntityCategory = "/entities/" PartitionCategory = "/partitions/" UserCategory = "/users/" RoleCategory = "/roles/" IndexCategory = "/indexes/" AliasCategory = "/aliases/" ImportJobCategory = "/jobs/import/" PrivilegeGroupCategory = "/privilege_groups/" CollectionFieldCategory = "/collections/fields/" ResourceGroupCategory = "/resource_groups/" ListAction = "list" HasAction = "has" DescribeAction = "describe" CreateAction = "create" DropAction = "drop" StatsAction = "get_stats" LoadStateAction = "get_load_state" RenameAction = "rename" LoadAction = "load" RefreshLoadAction = "refresh_load" ReleaseAction = "release" QueryAction = "query" GetAction = "get" DeleteAction = "delete" InsertAction = "insert" UpsertAction = "upsert" SearchAction = "search" AdvancedSearchAction = "advanced_search" HybridSearchAction = "hybrid_search" UpdatePasswordAction = "update_password" GrantRoleAction = "grant_role" RevokeRoleAction = "revoke_role" GrantPrivilegeAction = "grant_privilege" RevokePrivilegeAction = "revoke_privilege" GrantPrivilegeActionV2 = "grant_privilege_v2" RevokePrivilegeActionV2 = "revoke_privilege_v2" AlterAction = "alter" AlterPropertiesAction = "alter_properties" DropPropertiesAction = "drop_properties" GetProgressAction = "get_progress" // deprecated, keep it for compatibility, use `/v2/vectordb/jobs/import/describe` instead AddPrivilegesToGroupAction = "add_privileges_to_group" RemovePrivilegesFromGroupAction = "remove_privileges_from_group" TransferReplicaAction = "transfer_replica" )
v2
const ( ContextRequest = "request" ContextUsername = "username" VectorCollectionsPath = "/vector/collections" VectorCollectionsCreatePath = "/vector/collections/create" VectorCollectionsDescribePath = "/vector/collections/describe" VectorCollectionsDropPath = "/vector/collections/drop" VectorInsertPath = "/vector/insert" VectorUpsertPath = "/vector/upsert" VectorSearchPath = "/vector/search" VectorGetPath = "/vector/get" VectorQueryPath = "/vector/query" VectorDeletePath = "/vector/delete" ShardNumDefault = 1 EnableDynamic = true EnableAutoID = true DisableAutoID = false HTTPCollectionName = "collectionName" HTTPCollectionID = "collectionID" HTTPDbName = "dbName" HTTPDbID = "dbID" HTTPProperties = "properties" HTTPPartitionName = "partitionName" HTTPPartitionNames = "partitionNames" HTTPUserName = "userName" HTTPRoleName = "roleName" HTTPIndexName = "indexName" HTTPIndexField = "fieldName" HTTPAliasName = "aliasName" HTTPRequestData = "data" HTTPRequestDefaultValue = "defaultValue" DefaultDbName = "default" DefaultIndexName = "vector_idx" DefaultAliasName = "the_alias" DefaultOutputFields = "*" HTTPHeaderAllowInt64 = "Accept-Type-Allow-Int64" HTTPHeaderDBName = "DB-Name" HTTPHeaderRequestTimeout = "Request-Timeout" HTTPDefaultTimeout = 30 * time.Second HTTPReturnCode = "code" HTTPReturnMessage = "message" HTTPReturnData = "data" HTTPReturnCost = "cost" HTTPReturnLoadState = "loadState" HTTPReturnLoadProgress = "loadProgress" HTTPReturnHas = "has" HTTPReturnFieldName = "name" HTTPReturnFieldID = "id" HTTPReturnFieldType = "type" HTTPReturnFieldPrimaryKey = "primaryKey" HTTPReturnFieldPartitionKey = "partitionKey" HTTPReturnFieldClusteringKey = "clusteringKey" HTTPReturnFieldNullable = "nullable" HTTPReturnFieldDefaultValue = "defaultValue" HTTPReturnFieldAutoID = "autoId" HTTPReturnFieldElementType = "elementType" HTTPReturnDescription = "description" HTTPReturnFieldIsFunctionOutput = "isFunctionOutput" HTTPReturnFunctionName = "name" HTTPReturnFunctionID = "id" HTTPReturnFunctionType = "type" HTTPReturnFunctionInputFieldNames = "inputFieldNames" HTTPReturnFunctionOutputFieldNames = "outputFieldNames" HTTPReturnFunctionParams = "params" HTTPReturnIndexMetricType = "metricType" HTTPReturnIndexType = "indexType" HTTPReturnIndexTotalRows = "totalRows" HTTPReturnIndexPendingRows = "pendingRows" HTTPReturnIndexIndexedRows = "indexedRows" HTTPReturnIndexState = "indexState" HTTPReturnIndexFailReason = "failReason" HTTPReturnDistance = "distance" HTTPReturnRowCount = "rowCount" HTTPReturnObjectType = "objectType" HTTPReturnObjectName = "objectName" HTTPReturnPrivilege = "privilege" HTTPReturnGrantor = "grantor" HTTPReturnDbName = "dbName" HTTPReturnPrivilegeGroupName = "privilegeGroupName" HTTPReturnPrivileges = "privileges" HTTPReturnPrivilegeGroups = "privilegeGroups" DefaultMetricType = metric.COSINE DefaultPrimaryFieldName = "id" DefaultVectorFieldName = "vector" Dim = "dim" )
const ( ParamAnnsField = "anns_field" Params = "params" ParamRoundDecimal = "round_decimal" ParamOffset = "offset" ParamLimit = "limit" ParamRadius = "radius" ParamRangeFilter = "range_filter" ParamGroupByField = "group_by_field" ParamGroupSize = "group_size" ParamStrictGroupSize = "strict_group_size" BoundedTimestamp = 2 )
Variables ¶
var RestRequestInterceptorErr = errors.New("interceptor error placeholder")
Functions ¶
func CheckLimiter ¶
func GetAuthorization ¶
func HTTPReturnStream ¶
HTTPReturnStream uses custom jsonRender that encodes JSON data directly into the response stream, it uses less memory since it does not buffer the entire JSON structure before sending it, unlike c.JSON in HTTPReturn, which serializes the JSON fully in memory before writing it to the response.
func LoggerHandlerFunc ¶
func LoggerHandlerFunc() gin.HandlerFunc
func MetricsHandlerFunc ¶
func RequestHandlerFunc ¶
func WrapErrorToResponse ¶
func WrapErrorToResponse(err error) *milvuspb.BoolResponse
Types ¶
type AliasCollectionReq ¶
type AliasCollectionReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` AliasName string `json:"aliasName" binding:"required"` }
func (*AliasCollectionReq) GetAliasName ¶
func (req *AliasCollectionReq) GetAliasName() string
func (*AliasCollectionReq) GetCollectionName ¶
func (req *AliasCollectionReq) GetCollectionName() string
func (*AliasCollectionReq) GetDbName ¶
func (req *AliasCollectionReq) GetDbName() string
type AliasNameGetter ¶
type AliasNameGetter interface {
GetAliasName() string
}
type AliasReq ¶
type AliasReq struct { DbName string `json:"dbName"` AliasName string `json:"aliasName" binding:"required"` }
func (*AliasReq) GetAliasName ¶
type BaseGetter ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool represents a pool of buffers.
func (*BufferPool) Get ¶
func (p *BufferPool) Get() *bytes.Buffer
Get returns a buffer from the buffer pool. If the pool is empty, a new buffer is created and returned.
func (*BufferPool) Put ¶
func (p *BufferPool) Put(buf *bytes.Buffer)
Put adds a buffer back to the pool.
type CollectionDataReq ¶
type CollectionDataReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionName string `json:"partitionName"` Data []map[string]interface{} `json:"data" binding:"required"` }
func (*CollectionDataReq) GetDbName ¶
func (req *CollectionDataReq) GetDbName() string
type CollectionFieldReqWithParams ¶
type CollectionFieldReqWithParams struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` FieldName string `json:"fieldName" binding:"required"` FieldParams map[string]interface{} `json:"fieldParams"` }
func (*CollectionFieldReqWithParams) GetCollectionName ¶
func (req *CollectionFieldReqWithParams) GetCollectionName() string
func (*CollectionFieldReqWithParams) GetDbName ¶
func (req *CollectionFieldReqWithParams) GetDbName() string
func (*CollectionFieldReqWithParams) GetFieldName ¶
func (req *CollectionFieldReqWithParams) GetFieldName() string
type CollectionFilterReq ¶
type CollectionFilterReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionName string `json:"partitionName"` Filter string `json:"filter" binding:"required"` ExprParams map[string]interface{} `json:"exprParams"` }
func (*CollectionFilterReq) GetDbName ¶
func (req *CollectionFilterReq) GetDbName() string
type CollectionIDReq ¶
type CollectionIDReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionName string `json:"partitionName"` PartitionNames []string `json:"partitionNames"` OutputFields []string `json:"outputFields"` ID interface{} `json:"id" binding:"required"` }
func (*CollectionIDReq) GetDbName ¶
func (req *CollectionIDReq) GetDbName() string
type CollectionNameReq ¶
type CollectionNameReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionNames []string `json:"partitionNames"` // get partitions load state }
func (*CollectionNameReq) GetCollectionName ¶
func (req *CollectionNameReq) GetCollectionName() string
func (*CollectionNameReq) GetDbName ¶
func (req *CollectionNameReq) GetDbName() string
func (*CollectionNameReq) GetPartitionNames ¶
func (req *CollectionNameReq) GetPartitionNames() []string
type CollectionReq ¶
type CollectionReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` Dimension int32 `json:"dimension"` IDType string `json:"idType"` AutoID bool `json:"autoID"` MetricType string `json:"metricType"` PrimaryFieldName string `json:"primaryFieldName"` VectorFieldName string `json:"vectorFieldName"` Schema CollectionSchema `json:"schema"` IndexParams []IndexParam `json:"indexParams"` Params map[string]interface{} `json:"params"` }
func (*CollectionReq) GetDbName ¶
func (req *CollectionReq) GetDbName() string
type CollectionReqWithProperties ¶
type CollectionReqWithProperties struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` Properties map[string]interface{} `json:"properties"` }
func (*CollectionReqWithProperties) GetCollectionName ¶
func (req *CollectionReqWithProperties) GetCollectionName() string
func (*CollectionReqWithProperties) GetDbName ¶
func (req *CollectionReqWithProperties) GetDbName() string
type CollectionSchema ¶
type CollectionSchema struct { Fields []FieldSchema `json:"fields"` Functions []FunctionSchema `json:"functions"` AutoId bool `json:"autoID"` EnableDynamicField bool `json:"enableDynamicField"` }
type CreateCollectionReq ¶
type CreateCollectionReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" validate:"required"` Dimension int32 `json:"dimension" validate:"required"` Description string `json:"description"` MetricType string `json:"metricType"` PrimaryField string `json:"primaryField"` VectorField string `json:"vectorField"` EnableDynamicField bool `json:"enableDynamicField"` }
type DatabaseReq ¶
type DatabaseReq struct {
DbName string `json:"dbName"`
}
func (*DatabaseReq) GetDbName ¶
func (req *DatabaseReq) GetDbName() string
type DatabaseReqRequiredName ¶
type DatabaseReqRequiredName struct {
DbName string `json:"dbName" binding:"required"`
}
func (*DatabaseReqRequiredName) GetDbName ¶
func (req *DatabaseReqRequiredName) GetDbName() string
type DatabaseReqWithProperties ¶
type DatabaseReqWithProperties struct { DbName string `json:"dbName" binding:"required"` Properties map[string]interface{} `json:"properties"` }
func (*DatabaseReqWithProperties) GetDbName ¶
func (req *DatabaseReqWithProperties) GetDbName() string
type DropCollectionPropertiesReq ¶
type DropCollectionPropertiesReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` DeleteKeys []string `json:"deleteKeys"` }
func (*DropCollectionPropertiesReq) GetCollectionName ¶
func (req *DropCollectionPropertiesReq) GetCollectionName() string
func (*DropCollectionPropertiesReq) GetDbName ¶
func (req *DropCollectionPropertiesReq) GetDbName() string
type DropCollectionReq ¶
type DropIndexPropertiesReq ¶
type DropIndexPropertiesReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` IndexName string `json:"indexName" binding:"required"` DeleteKeys []string `json:"deleteKeys"` }
func (*DropIndexPropertiesReq) GetCollectionName ¶
func (req *DropIndexPropertiesReq) GetCollectionName() string
func (*DropIndexPropertiesReq) GetDbName ¶
func (req *DropIndexPropertiesReq) GetDbName() string
func (*DropIndexPropertiesReq) GetIndexName ¶
func (req *DropIndexPropertiesReq) GetIndexName() string
type FieldData ¶
type FieldData struct { Type schemapb.DataType `json:"type,omitempty"` FieldName string `json:"field_name,omitempty"` Field json.RawMessage `json:"field,omitempty"` // we use postpone the unmarshal until we know the type FieldID int64 `json:"field_id,omitempty"` }
FieldData is the field data in RESTful request that can be convertd to schemapb.FieldData
type FieldSchema ¶
type FieldSchema struct { FieldName string `json:"fieldName" binding:"required"` DataType string `json:"dataType" binding:"required"` ElementDataType string `json:"elementDataType"` IsPrimary bool `json:"isPrimary"` IsPartitionKey bool `json:"isPartitionKey"` IsClusteringKey bool `json:"isClusteringKey"` ElementTypeParams map[string]interface{} `json:"elementTypeParams" binding:"required"` Nullable bool `json:"nullable" binding:"required"` DefaultValue interface{} `json:"defaultValue" binding:"required"` }
type FilesGetter ¶
type FilesGetter interface {
GetFiles() [][]string
}
type FunctionSchema ¶
type FunctionSchema struct { FunctionName string `json:"name" binding:"required"` Description string `json:"description"` FunctionType string `json:"type" binding:"required"` InputFieldNames []string `json:"inputFieldNames" binding:"required"` OutputFieldNames []string `json:"outputFieldNames" binding:"required"` Params map[string]interface{} `json:"params"` }
type GrantReq ¶
type GrantV2Req ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers handles http requests
func NewHandlers ¶
func NewHandlers(proxy types.ProxyComponent) *Handlers
NewHandlers creates a new Handlers
func (*Handlers) RegisterRoutesTo ¶
RegisterRouters registers routes to given router
type HandlersV1 ¶
type HandlersV1 struct {
// contains filtered or unexported fields
}
HandlersV1 handles http requests
func NewHandlersV1 ¶
func NewHandlersV1(proxyComponent types.ProxyComponent) *HandlersV1
NewHandlers creates a new HandlersV1
func (*HandlersV1) RegisterRoutesToV1 ¶
func (h *HandlersV1) RegisterRoutesToV1(router gin.IRouter)
type HandlersV2 ¶
type HandlersV2 struct {
// contains filtered or unexported fields
}
func NewHandlersV2 ¶
func NewHandlersV2(proxyClient types.ProxyComponent) *HandlersV2
func (*HandlersV2) GetCollectionSchema ¶
func (h *HandlersV2) GetCollectionSchema(ctx context.Context, c *gin.Context, dbName, collectionName string) (*schemapb.CollectionSchema, error)
func (*HandlersV2) RegisterRoutesToV2 ¶
func (h *HandlersV2) RegisterRoutesToV2(router gin.IRouter)
type HybridSearchReq ¶
type HybridSearchReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionNames []string `json:"partitionNames"` Search []SubSearchReq `json:"search"` Rerank Rand `json:"rerank"` Limit int32 `json:"limit"` GroupByField string `json:"groupingField"` GroupSize int32 `json:"groupSize"` StrictGroupSize bool `json:"strictGroupSize"` OutputFields []string `json:"outputFields"` ConsistencyLevel string `json:"consistencyLevel"` }
func (*HybridSearchReq) GetDbName ¶
func (req *HybridSearchReq) GetDbName() string
type ImportReq ¶
type ImportReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionName string `json:"partitionName"` Files [][]string `json:"files" binding:"required"` Options map[string]string `json:"options"` }
func (*ImportReq) GetCollectionName ¶
func (*ImportReq) GetOptions ¶
func (*ImportReq) GetPartitionName ¶
type IndexNameGetter ¶
type IndexNameGetter interface {
GetIndexName() string
}
type IndexParam ¶
type IndexParamReq ¶
type IndexParamReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` IndexParams []IndexParam `json:"indexParams" binding:"required"` }
func (*IndexParamReq) GetDbName ¶
func (req *IndexParamReq) GetDbName() string
type IndexReq ¶
type IndexReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` IndexName string `json:"indexName" binding:"required"` }
func (*IndexReq) GetCollectionName ¶
func (*IndexReq) GetIndexName ¶
type IndexReqWithProperties ¶
type IndexReqWithProperties struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` IndexName string `json:"indexName" binding:"required"` Properties map[string]interface{} `json:"properties"` }
func (*IndexReqWithProperties) GetCollectionName ¶
func (req *IndexReqWithProperties) GetCollectionName() string
func (*IndexReqWithProperties) GetDbName ¶
func (req *IndexReqWithProperties) GetDbName() string
func (*IndexReqWithProperties) GetIndexName ¶
func (req *IndexReqWithProperties) GetIndexName() string
type JobIDGetter ¶
type JobIDGetter interface {
GetJobID() string
}
type NewPasswordReq ¶
type OptionalCollectionNameReq ¶
type OptionalCollectionNameReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName"` }
func (*OptionalCollectionNameReq) GetCollectionName ¶
func (req *OptionalCollectionNameReq) GetCollectionName() string
func (*OptionalCollectionNameReq) GetDbName ¶
func (req *OptionalCollectionNameReq) GetDbName() string
type OptionsGetter ¶
type PartitionReq ¶
type PartitionReq struct { // CollectionNameReq DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionName string `json:"partitionName" binding:"required"` }
func (*PartitionReq) GetCollectionName ¶
func (req *PartitionReq) GetCollectionName() string
func (*PartitionReq) GetDbName ¶
func (req *PartitionReq) GetDbName() string
func (*PartitionReq) GetPartitionName ¶
func (req *PartitionReq) GetPartitionName() string
type PartitionsReq ¶
type PartitionsReq struct { // CollectionNameReq DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionNames []string `json:"partitionNames" binding:"required"` }
func (*PartitionsReq) GetDbName ¶
func (req *PartitionsReq) GetDbName() string
type PasswordReq ¶
type PrivilegeGroupReq ¶
type QueryReqV2 ¶
type QueryReqV2 struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` PartitionNames []string `json:"partitionNames"` OutputFields []string `json:"outputFields"` Filter string `json:"filter"` Limit int32 `json:"limit"` Offset int32 `json:"offset"` ExprParams map[string]interface{} `json:"exprParams"` }
func (*QueryReqV2) GetDbName ¶
func (req *QueryReqV2) GetDbName() string
type RenameCollectionReq ¶
type RenameCollectionReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` NewCollectionName string `json:"newCollectionName" binding:"required"` NewDbName string `json:"newDbName"` }
func (*RenameCollectionReq) GetDbName ¶
func (req *RenameCollectionReq) GetDbName() string
type ResourceGroupConfig ¶
type ResourceGroupConfig struct { Requests *ResourceGroupLimit `json:"requests" binding:"required"` Limits *ResourceGroupLimit `json:"limits" binding:"required"` TransferFrom []*ResourceGroupTransfer `json:"transfer_from"` TransferTo []*ResourceGroupTransfer `json:"transfer_to"` NodeFilter *ResourceGroupNodeFilter `json:"node_filter"` }
func (*ResourceGroupConfig) GetLimits ¶
func (req *ResourceGroupConfig) GetLimits() *ResourceGroupLimit
func (*ResourceGroupConfig) GetNodeFilter ¶
func (req *ResourceGroupConfig) GetNodeFilter() *ResourceGroupNodeFilter
func (*ResourceGroupConfig) GetRequests ¶
func (req *ResourceGroupConfig) GetRequests() *ResourceGroupLimit
func (*ResourceGroupConfig) GetTransferFrom ¶
func (req *ResourceGroupConfig) GetTransferFrom() []*ResourceGroupTransfer
func (*ResourceGroupConfig) GetTransferTo ¶
func (req *ResourceGroupConfig) GetTransferTo() []*ResourceGroupTransfer
type ResourceGroupLimit ¶
type ResourceGroupLimit struct {
NodeNum int32 `json:"node_num" binding:"required"`
}
func (*ResourceGroupLimit) GetNodeNum ¶
func (req *ResourceGroupLimit) GetNodeNum() int32
type ResourceGroupNodeFilter ¶
type ResourceGroupNodeFilter struct {
NodeLabels map[string]string `json:"node_labels" binding:"required"`
}
func (*ResourceGroupNodeFilter) GetNodeLabels ¶
func (req *ResourceGroupNodeFilter) GetNodeLabels() map[string]string
type ResourceGroupReq ¶
type ResourceGroupReq struct { Name string `json:"name" binding:"required"` Config *ResourceGroupConfig `json:"config"` }
func (*ResourceGroupReq) GetConfig ¶
func (req *ResourceGroupReq) GetConfig() *ResourceGroupConfig
func (*ResourceGroupReq) GetName ¶
func (req *ResourceGroupReq) GetName() string
type ResourceGroupTransfer ¶
type ResourceGroupTransfer struct {
ResourceGroup string `json:"resource_group" binding:"required"`
}
func (*ResourceGroupTransfer) GetResourceGroup ¶
func (req *ResourceGroupTransfer) GetResourceGroup() string
type RestRequestInterceptor ¶
type ReturnErrMsg ¶
type RoleNameGetter ¶
type RoleNameGetter interface {
GetRoleName() string
}
type RoleReq ¶
type RoleReq struct { DbName string `json:"dbName"` RoleName string `json:"roleName" binding:"required"` }
func (*RoleReq) GetRoleName ¶
type SearchReq ¶
type SearchReq struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" validate:"required"` Filter string `json:"filter"` Limit int32 `json:"limit"` Offset int32 `json:"offset"` OutputFields []string `json:"outputFields"` Vector []float32 `json:"vector"` Params map[string]float64 `json:"params"` }
type SearchReqV2 ¶
type SearchReqV2 struct { DbName string `json:"dbName"` CollectionName string `json:"collectionName" binding:"required"` Data []interface{} `json:"data" binding:"required"` AnnsField string `json:"annsField"` PartitionNames []string `json:"partitionNames"` Filter string `json:"filter"` GroupByField string `json:"groupingField"` GroupSize int32 `json:"groupSize"` StrictGroupSize bool `json:"strictGroupSize"` Limit int32 `json:"limit"` Offset int32 `json:"offset"` OutputFields []string `json:"outputFields"` SearchParams searchParams `json:"searchParams"` ConsistencyLevel string `json:"consistencyLevel"` ExprParams map[string]interface{} `json:"exprParams"` // not use Params any more, just for compatibility Params map[string]float64 `json:"params"` }
func (*SearchReqV2) GetDbName ¶
func (req *SearchReqV2) GetDbName() string
type SearchRequest ¶
type SearchRequest struct { Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` DbName string `protobuf:"bytes,2,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` CollectionName string `protobuf:"bytes,3,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` PartitionNames []string `protobuf:"bytes,4,rep,name=partition_names,json=partitionNames,proto3" json:"partition_names,omitempty"` Dsl string `protobuf:"bytes,5,opt,name=dsl,proto3" json:"dsl,omitempty"` DslType commonpb.DslType `protobuf:"varint,7,opt,name=dsl_type,json=dslType,proto3,enum=milvus.proto.common.DslType" json:"dsl_type,omitempty"` BinaryVectors [][]byte `json:"binary_vectors,omitempty"` Vectors [][]float32 `json:"vectors,omitempty"` OutputFields []string `protobuf:"bytes,8,rep,name=output_fields,json=outputFields,proto3" json:"output_fields,omitempty"` SearchParams []*commonpb.KeyValuePair `protobuf:"bytes,9,rep,name=search_params,json=searchParams,proto3" json:"search_params,omitempty"` TravelTimestamp uint64 `protobuf:"varint,10,opt,name=travel_timestamp,json=travelTimestamp,proto3" json:"travel_timestamp,omitempty"` GuaranteeTimestamp uint64 `protobuf:"varint,11,opt,name=guarantee_timestamp,json=guaranteeTimestamp,proto3" json:"guarantee_timestamp,omitempty"` Nq int64 `protobuf:"varint,12,opt,name=nq,proto3" json:"nq,omitempty"` }
SearchRequest is the RESTful request body for search
type SingleInsertReq ¶
type SingleUpsertReq ¶
type SubSearchReq ¶
type SubSearchReq struct { Data []interface{} `json:"data" binding:"required"` AnnsField string `json:"annsField"` Filter string `json:"filter"` GroupByField string `json:"groupingField"` MetricType string `json:"metricType"` Limit int32 `json:"limit"` Offset int32 `json:"offset"` SearchParams searchParams `json:"params"` ExprParams map[string]interface{} `json:"exprParams"` }
type TransferReplicaReq ¶
type TransferReplicaReq struct { SourceRgName string `json:"sourceRgName" binding:"required"` TargetRgName string `json:"targetRgName" binding:"required"` CollectionName string `json:"collectionName" binding:"required"` ReplicaNum int64 `json:"replicaNum" binding:"required"` }
func (*TransferReplicaReq) GetCollectionName ¶
func (req *TransferReplicaReq) GetCollectionName() string
func (*TransferReplicaReq) GetReplicaNum ¶
func (req *TransferReplicaReq) GetReplicaNum() int64
func (*TransferReplicaReq) GetSourceRgName ¶
func (req *TransferReplicaReq) GetSourceRgName() string
func (*TransferReplicaReq) GetTargetRgName ¶
func (req *TransferReplicaReq) GetTargetRgName() string
type UpdateResourceGroupReq ¶
type UpdateResourceGroupReq struct {
ResourceGroups map[string]*ResourceGroupConfig `json:"resource_groups" binding:"required"`
}
func (*UpdateResourceGroupReq) GetResourceGroups ¶
func (req *UpdateResourceGroupReq) GetResourceGroups() map[string]*ResourceGroupConfig
type UserNameGetter ¶
type UserNameGetter interface {
GetUserName() string
}
type UserReq ¶
type UserReq struct {
UserName string `json:"userName" binding:"required"`
}
func (*UserReq) GetUserName ¶
type UserRoleReq ¶
type VectorIDs ¶
type VectorIDs struct { CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` FieldName string `protobuf:"bytes,2,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` PartitionNames []string `json:"partition_names"` IDArray []int64 `json:"id_array,omitempty"` }
VectorIDs is an array of id reference in milvus
type VectorsArray ¶
type VectorsArray struct { // Dim of vectors or binary_vectors, not needed when use ids Dim int64 `json:"dim,omitempty"` // Vectors is an array of vector divided by given dim. Disabled when ids or binary_vectors is set Vectors []float32 `json:"vectors,omitempty"` // Vectors is an array of binary vector divided by given dim. Disabled when IDs is set BinaryVectors []byte `json:"binary_vectors,omitempty"` // IDs of vector field in milvus, if not nil, vectors will be ignored IDs *VectorIDs `json:"ids,omitempty"` }
VectorsArray is vector array, assigned by vectors or ids
func (*VectorsArray) AsPbVectorArray ¶
func (v *VectorsArray) AsPbVectorArray() *milvuspb.VectorsArray
AsPbVectorArray convert as milvuspb.VectorArray
type WrappedCalcDistanceRequest ¶
type WrappedCalcDistanceRequest struct { Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` OpLeft VectorsArray `json:"op_left,omitempty"` OpRight VectorsArray `json:"op_right,omitempty"` Params []*commonpb.KeyValuePair `json:"params,omitempty"` }
WrappedCalcDistanceRequest is the RESTful request body for calc distance
type WrappedCreateCollectionRequest ¶
type WrappedCreateCollectionRequest struct { // Not useful for now Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` // Not useful for now DbName string `protobuf:"bytes,2,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` // The unique collection name in milvus.(Required) CollectionName string `protobuf:"bytes,3,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` // The serialized `schema.CollectionSchema`(Required) Schema schemapb.CollectionSchema `protobuf:"bytes,4,opt,name=schema,proto3" json:"schema,omitempty"` // Once set, no modification is allowed (Optional) // https://github.com/milvus-io/milvus/issues/6690 ShardsNum int32 `protobuf:"varint,5,opt,name=shards_num,json=shardsNum,proto3" json:"shards_num,omitempty"` // The consistency level that the collection used, modification is not supported now. ConsistencyLevel commonpb.ConsistencyLevel `` /* 152-byte string literal not displayed */ Properties []*commonpb.KeyValuePair `protobuf:"bytes,13,rep,name=properties,proto3" json:"properties,omitempty"` }
WrappedCreateCollectionRequest wraps CreateCollectionRequest
type WrappedInsertRequest ¶
type WrappedInsertRequest struct { Base *commonpb.MsgBase `json:"base,omitempty"` DbName string `json:"db_name,omitempty"` CollectionName string `json:"collection_name,omitempty"` PartitionName string `json:"partition_name,omitempty"` FieldsData []*FieldData `json:"fields_data,omitempty"` HashKeys []uint32 `json:"hash_keys,omitempty"` NumRows uint32 `json:"num_rows,omitempty"` }
WrappedInsertRequest is the InsertRequest wrapped for RESTful request
func (*WrappedInsertRequest) AsInsertRequest ¶
func (w *WrappedInsertRequest) AsInsertRequest() (*milvuspb.InsertRequest, error)
type Writer ¶
type Writer struct { gin.ResponseWriter // contains filtered or unexported fields }
Writer is a writer with memory buffer
func NewWriter ¶
func NewWriter(w gin.ResponseWriter, buf *bytes.Buffer) *Writer
NewWriter will return a timeout.Writer pointer
func (*Writer) Status ¶
Status we must override Status func here, or the http status code returned by gin.Context.Writer.Status() will always be 200 in other custom gin middlewares.
func (*Writer) WriteHeader ¶
WriteHeader sends an HTTP response header with the provided status code. If the response writer has already written headers or if a timeout has occurred, this method does nothing.