XU XUv0.8.8
中文

API

#github.com/xulang-org/packages/qdrant

import: qdrant #github.com/xulang-org/packages/qdrant

counts: 5 fns, 19 methods, 5 types, 0 consts, 0 ifaces

Public API convenience helpers for Qdrant Vector Database

github.com/xulang-org/packages · 0.1.1 · Install and use

open

XuAPI
pub fn open(endpoint string) Client

Purpose

Public API convenience helpers for Qdrant Vector Database

Parameters

endpoint string
endpoint (string)

Returns

Client — a value of this type

open_auth

XuAPI
pub fn open_auth(endpoint string, api_key string) Client

Purpose

Open auth.

Parameters

endpoint string
endpoint (string)
api_key string
api_key (string)

Returns

Client — a value of this type

struct Response

XuAPI
pub struct Response {
    pub status_code int
    pub body string
}

Purpose

Public struct `Response`.

Parameters

status_code int
field (int)
body string
body

struct Client

XuAPI
pub struct Client {
    pub host string
    pub port int
    pub api_key string
}

Purpose

Public struct `Client`.

Parameters

host string
host
port int
port
api_key string
field (string)

new_client

XuAPI
pub fn new_client(endpoint string, api_key string) Client

Purpose

Construct client.

Parameters

endpoint string
endpoint (string)
api_key string
api_key (string)

Returns

Client — a value of this type

(&mut Client) request

XuAPI
pub fn (c &mut Client) request(method string, path string, body string) Response

Purpose

Call `request` on `&mut Client`. Throws on failure.

Parameters

c &mut Client
receiver &mut Client (exclusive borrow)
method string
method (string)
path string
filesystem path (string)
body string
body (string)

Returns

Response — a value of this type

(&mut Client) ping

XuAPI
pub fn (c &mut Client) ping() bool

Purpose

Call `ping` on `&mut Client`.

Parameters

c &mut Client
receiver &mut Client (exclusive borrow)

Returns

bool — true or false

(&mut Client) create_collection

XuAPI
pub fn (c &mut Client) create_collection(name string, vector_size int, distance string) bool

Purpose

Method on `&mut Client`: create collection.

Parameters

c &mut Client
receiver &mut Client (exclusive borrow)
name string
name (string)
vector_size int
vector_size (int)
distance string
distance (string)

Returns

bool — true or false

(&mut Client) collection_exists

XuAPI
pub fn (c &mut Client) collection_exists(name string) bool

Purpose

Method on `&mut Client`: collection exists.

Parameters

c &mut Client
receiver &mut Client (exclusive borrow)
name string
name (string)

Returns

bool — true or false

(&mut Client) delete_collection

XuAPI
pub fn (c &mut Client) delete_collection(name string) bool

Purpose

Method on `&mut Client`: delete collection.

Parameters

c &mut Client
receiver &mut Client (exclusive borrow)
name string
name (string)

Returns

bool — true or false

struct Point

XuAPI
pub struct Point {
    pub id int
    pub vector []string
    pub payload_json string
}

Purpose

Public struct `Point`.

Parameters

id int
field (int)
vector []string
field ([]string)
payload_json string
field (string)

struct ScoredPoint

XuAPI
pub struct ScoredPoint {
    pub id int
    pub score string
    pub payload_json string
}

Purpose

Public struct `ScoredPoint`.

Parameters

id int
field (int)
score string
field (string)
payload_json string
field (string)

(&mut Client) upsert_point

XuAPI
pub fn (c &mut Client) upsert_point(collection string, id int, vector []string, payload_json string) bool

Purpose

Method on `&mut Client`: upsert point.

Parameters

c &mut Client
receiver &mut Client (exclusive borrow)
collection string
collection (string)
id int
id (int)
vector []string
vector ([]string)
payload_json string
payload_json (string)

Returns

bool — true or false

struct Pool

XuAPI
pub struct Pool {
    pub host string
    pub port int
    pub api_key string
    pub state chan pool.State
    pub max_idle int
}

Purpose

Connection Pool for Qdrant Vector Database. Manages reusable TCP/HTTP socket connections.

Parameters

host string
host
port int
port
api_key string
field (string)
state chan pool.State
field (channel; type chan pool.State)
max_idle int
field (int)

new_pool

XuAPI
pub fn new_pool(endpoint string, api_key string, max_idle int) Pool

Purpose

Construct pool.

Parameters

endpoint string
endpoint (string)
api_key string
api_key (string)
max_idle int
max_idle (int)

Returns

Pool — a value of this type

open_pool

XuAPI
pub fn open_pool(endpoint string, api_key string, max_idle int) Pool

Purpose

Open pool.

Parameters

endpoint string
endpoint (string)
api_key string
api_key (string)
max_idle int
max_idle (int)

Returns

Pool — a value of this type

(&Pool) get

XuAPI
pub fn (p &Pool) get() Client

Purpose

Call `get` on `&Pool`.

Parameters

p &Pool
receiver &Pool (borrow)

Returns

Client — a value of this type

(&Pool) dup

XuAPI
pub fn (p &Pool) dup() Pool

Purpose

Shares sockets and close state; clones configuration strings.

Parameters

p &Pool
receiver &Pool (borrow)

Returns

Pool — a value of this type

(&Pool) get_conn

XuAPI
pub fn (p &Pool) get_conn() int

Purpose

Method on `&Pool`: read conn.

Parameters

p &Pool
receiver &Pool (borrow)

Returns

int — a value of this type

(&Pool) put_conn

XuAPI
pub fn (p &Pool) put_conn(fd int)

Purpose

Method on `&Pool`: put connection.

Parameters

p &Pool
receiver &Pool (borrow)
fd int
file descriptor (int)

(&Pool) discard_conn

XuAPI
pub fn (p &Pool) discard_conn(fd int)

Purpose

Method on `&Pool`: discard connection.

Parameters

p &Pool
receiver &Pool (borrow)
fd int
file descriptor (int)

(&Pool) create_collection

XuAPI
pub fn (p &Pool) create_collection(name string, vector_size int, distance string) bool

Purpose

Method on `&Pool`: create collection.

Parameters

p &Pool
receiver &Pool (borrow)
name string
name (string)
vector_size int
vector_size (int)
distance string
distance (string)

Returns

bool — true or false

(&Pool) collection_exists

XuAPI
pub fn (p &Pool) collection_exists(name string) bool

Purpose

Method on `&Pool`: collection exists.

Parameters

p &Pool
receiver &Pool (borrow)
name string
name (string)

Returns

bool — true or false

(&Pool) delete_collection

XuAPI
pub fn (p &Pool) delete_collection(name string) bool

Purpose

Method on `&Pool`: delete collection.

Parameters

p &Pool
receiver &Pool (borrow)
name string
name (string)

Returns

bool — true or false

(&Pool) upsert_point

XuAPI
pub fn (p &Pool) upsert_point(collection string, id int, vector []string, payload_json string) bool

Purpose

Method on `&Pool`: upsert point.

Parameters

p &Pool
receiver &Pool (borrow)
collection string
collection (string)
id int
id (int)
vector []string
vector ([]string)
payload_json string
payload_json (string)

Returns

bool — true or false

(&Pool) ping

XuAPI
pub fn (p &Pool) ping() bool

Purpose

Call `ping` on `&Pool`.

Parameters

p &Pool
receiver &Pool (borrow)

Returns

bool — true or false

(&Pool) close

XuAPI
pub fn (p &Pool) close()

Purpose

Method on `&Pool`: close the resource.

Parameters

p &Pool
receiver &Pool (borrow)