godashvector

package module
v0.0.0-...-100d70f Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 3 Imported by: 0

README

godashvector

godashvector是一个golang实现的阿里云DashVector SDK,具体使用方法可以参考example_test.go中的调用

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Code      int    `json:"code"`
	Message   string `json:"message"`
	RequestID string `json:"request_id"`
}

BaseResponse base response

type Client

type Client struct {
	APIKey      string
	Endpoint    string
	RestyClient *resty.Client
}

Client dashvector client

func NewClient

func NewClient(apiKey, endpoint string) *Client

NewClient creates a new dashvector client

func (*Client) CreateCollection

func (c *Client) CreateCollection(req *CollectionCreateRequest) (resp *CollectionCreateResponse, err error)

CreateCollection 创建Collection

func (*Client) CreateDocument

func (c *Client) CreateDocument(req *DocumentCreateRequest) (resp *DocumentCreateResponse, err error)

CreateDocument 创建文档

func (*Client) CreatePartition

func (c *Client) CreatePartition(req *PartitionCreateRequest) (resp *PartitionCreateResponse, err error)

CreatePartition 创建Partition

func (*Client) DeleteCollection

func (c *Client) DeleteCollection(req *CollectionDeleteRequest) (resp *CollectionDeleteResponse, err error)

DeleteCollection 删除Collection

func (*Client) DeleteDocument

func (c *Client) DeleteDocument(req *DocumentDeleteRequest) (resp *DocumentDeleteResponse, err error)

DeleteDocument 删除文档

func (*Client) DeletePartition

func (c *Client) DeletePartition(req *PartitionDeleteRequest) (resp *PartitionDeleteResponse, err error)

DeletePartition 删除Partition

func (*Client) DescribeCollection

func (c *Client) DescribeCollection(req *CollectionDetailRequest) (resp *CollectionDetailResponse, err error)

DescribeCollection 描述Collection

func (*Client) DescribePartition

func (c *Client) DescribePartition(req *PartitionDetailRequest) (resp *PartitionDetailResponse, err error)

DescribePartition 描述Partition

func (*Client) GetDocument

func (c *Client) GetDocument(req *DocumentGetRequest) (resp *DocumentGetResponse, err error)

GetDocument 获取文档

func (*Client) ListCollection

func (c *Client) ListCollection(req *CollectionListRequest) (resp *CollectionListResponse, err error)

ListCollection 列Collection

func (*Client) ListPartition

func (c *Client) ListPartition(req *PartitionListRequest) (resp *PartitionListResponse, err error)

ListPartition 列Partition

func (*Client) QueryDocument

func (c *Client) QueryDocument(req *DocumentQueryRequest) (resp *DocumentQueryResponse, err error)

QueryDocument 查询文档

func (*Client) StatsCollection

func (c *Client) StatsCollection(req *CollectionStatsRequest) (resp *CollectionStatsResponse, err error)

StatsCollection 统计Collection

func (*Client) StatsPartition

func (c *Client) StatsPartition(req *PartitionStatsRequest) (resp *PartitionStatsResponse, err error)

StatsPartition 统计Partition

func (*Client) UpdateDocument

func (c *Client) UpdateDocument(req *DocumentUpdateRequest) (resp *DocumentUpdateResponse, err error)

UpdateDocument 更新文档

func (*Client) UpsertDocument

func (c *Client) UpsertDocument(req *DocumentUpsertRequest) (resp *DocumentUpsertResponse, err error)

UpsertDocument 插入或更新文档

type CollectionCreateRequest

type CollectionCreateRequest struct {
	Name         string            `json:"name"`
	Dimension    int               `json:"dimension"`
	Dtype        string            `json:"dtype"`
	Metric       string            `json:"metric"`
	FieldsSchema map[string]string `json:"fields_schema"`
}

CollectionCreateRequest 创建Collection请求

type CollectionCreateResponse

type CollectionCreateResponse struct {
	BaseResponse
}

CollectionCreateResponse 创建Collection响应

type CollectionDeleteRequest

type CollectionDeleteRequest struct {
	Name string `json:"name"`
}

CollectionDeleteRequest 删除Collection请求

type CollectionDeleteResponse

type CollectionDeleteResponse struct {
	BaseResponse
}

CollectionDeleteResponse 删除Collection响应

type CollectionDetailRequest

type CollectionDetailRequest struct {
	Name string `json:"name"`
}

CollectionDetailRequest 描述Collection请求

type CollectionDetailResponse

type CollectionDetailResponse struct {
	BaseResponse
	Output CollectionMeta `json:"output"`
}

CollectionDetailResponse 描述Collection响应

type CollectionListRequest

type CollectionListRequest struct {
}

CollectionListRequest 列Collection请求

type CollectionListResponse

type CollectionListResponse struct {
	BaseResponse
	Output []string `json:"output"`
}

CollectionListResponse 列Collection响应

type CollectionMeta

type CollectionMeta struct {
	Name       string            `json:"name"`
	Dimension  int               `json:"dimension"`
	Dtype      string            `json:"dtype"`
	Metric     string            `json:"metric"`
	Status     Status            `json:"status"`
	Fields     map[string]string `json:"fields"`
	Partitions map[string]Status `json:"partitions"`
}

CollectionMeta struct

type CollectionStats

type CollectionStats struct {
	TotalDocCount     string                    `json:"total_doc_count"`
	IndexCompleteness float64                   `json:"index_completeness"`
	Partitions        map[string]PartitionStats `json:"partitions"`
}

CollectionStats struct

type CollectionStatsRequest

type CollectionStatsRequest struct {
	Name string `json:"name"`
}

CollectionStatsRequest 统计Collection请求

type CollectionStatsResponse

type CollectionStatsResponse struct {
	BaseResponse
	Output CollectionStats `json:"output"`
}

CollectionStatsResponse 统计Collection响应

type Doc

type Doc struct {
	ID     string                 `json:"id"`
	Vector interface{}            `json:"vector"`
	Fields map[string]interface{} `json:"fields"`
	Score  float64                `json:"score"`
}

Doc struct

type DocumentCreateRequest

type DocumentCreateRequest struct {
	CollectionName string  `json:"collection_name"`
	Partition      *string `json:"partition"`
	Docs           []Doc   `json:"docs"`
}

DocumentCreateRequest 创建Document请求

type DocumentCreateResponse

type DocumentCreateResponse struct {
	BaseResponse
}

DocumentCreateResponse 创建Document响应

type DocumentDeleteRequest

type DocumentDeleteRequest struct {
	CollectionName string   `json:"collection_name"`
	Partition      *string  `json:"partition"`
	IDs            []string `json:"ids"`
	DeleteAll      *bool    `json:"delete_all"`
}

DocumentDeleteRequest 删除Document请求

type DocumentDeleteResponse

type DocumentDeleteResponse struct {
	BaseResponse
}

DocumentDeleteResponse 删除Document响应

type DocumentGetRequest

type DocumentGetRequest struct {
	CollectionName string   `json:"collection_name"`
	Partition      *string  `json:"partition"`
	IDs            []string `json:"ids"`
}

DocumentGetRequest 获取Document请求

type DocumentGetResponse

type DocumentGetResponse struct {
	BaseResponse
	Output map[string]Doc `json:"output"`
}

DocumentGetResponse 获取Document响应

type DocumentQueryRequest

type DocumentQueryRequest struct {
	CollectionName string     `json:"collection_name"`
	Partition      *string    `json:"partition"`
	Vector         *[]float64 `json:"vector"`
	ID             *string    `json:"id"`
	TopK           *int       `json:"topk"`
	Filter         *string    `json:"filter"`
	IncludeVector  *bool      `json:"include_vector"`
	OutputFields   *[]string  `json:"output_fields"`
}

DocumentQueryRequest 查询Document请求

type DocumentQueryResponse

type DocumentQueryResponse struct {
	BaseResponse
	Output []Doc `json:"output"`
}

DocumentQueryResponse 查询Document响应

type DocumentUpdateRequest

type DocumentUpdateRequest struct {
	CollectionName string  `json:"collection_name"`
	Partition      *string `json:"partition"`
	Docs           []Doc   `json:"docs"`
}

DocumentUpdateRequest 更新Document请求

type DocumentUpdateResponse

type DocumentUpdateResponse struct {
	BaseResponse
}

DocumentUpdateResponse 更新Document响应

type DocumentUpsertRequest

type DocumentUpsertRequest struct {
	CollectionName string  `json:"collection_name"`
	Partition      *string `json:"partition"`
	Docs           []Doc   `json:"docs"`
}

DocumentUpsertRequest 插入或更新Document请求

type DocumentUpsertResponse

type DocumentUpsertResponse struct {
	BaseResponse
}

DocumentUpsertResponse 插入或更新Document响应

type FieldDataType

type FieldDataType map[string]interface{}

FieldDataType field data类型

type PartitionCreateRequest

type PartitionCreateRequest struct {
	CollectionName string `json:"collection_name"`
	Name           string `json:"name"`
}

PartitionCreateRequest 创建Partition请求

type PartitionCreateResponse

type PartitionCreateResponse struct {
	BaseResponse
}

PartitionCreateResponse 创建Partition响应

type PartitionDeleteRequest

type PartitionDeleteRequest struct {
	CollectionName string `json:"collection_name"`
	Name           string `json:"name"`
}

PartitionDeleteRequest 删除Partition请求

type PartitionDeleteResponse

type PartitionDeleteResponse struct {
	BaseResponse
}

PartitionDeleteResponse 删除Partition响应

type PartitionDetailRequest

type PartitionDetailRequest struct {
	CollectionName string `json:"collection_name"`
	Name           string `json:"name"`
}

PartitionDetailRequest 描述Partition请求

type PartitionDetailResponse

type PartitionDetailResponse struct {
	BaseResponse
	Output Status `json:"output"`
}

PartitionDetailResponse 描述Partition响应

type PartitionListRequest

type PartitionListRequest struct {
	CollectionName string `json:"collection_name"`
}

PartitionListRequest 列Partition请求

type PartitionListResponse

type PartitionListResponse struct {
	BaseResponse
	Output []string `json:"output"`
}

PartitionListResponse 列Partition响应

type PartitionStats

type PartitionStats struct {
	TotalDocCount string `json:"total_doc_count"`
}

PartitionStats struct

type PartitionStatsRequest

type PartitionStatsRequest struct {
	CollectionName string `json:"collection_name"`
	Name           string `json:"name"`
}

PartitionStatsRequest 统计Partition请求

type PartitionStatsResponse

type PartitionStatsResponse struct {
	BaseResponse
	Output PartitionStats `json:"output"`
}

PartitionStatsResponse 统计Partition响应

type Status

type Status string

Status enum

Jump to

Keyboard shortcuts

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