XU XUv0.8.8
EN

API

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

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

counts: 3 函数, 8 方法, 2 类型, 0 常量, 0 方法集

扩展包 `neo4j #github.com/xulang-org/packages/neo4j`,由模块 github.com/xulang-org/packages 提供。

github.com/xulang-org/packages · 0.1.1 · 安装与使用

struct Neo4jClient

XuAPI
pub struct Neo4jClient {
    pub host string
    pub port int
    pub user string
    pub password string
    pub database string
    pub auth_header string
}

用途

公开结构体 `Neo4jClient`。

参数

host string
主机
port int
端口
user string
字段(string)
password string
字段(string)
database string
字段(string)
auth_header string
字段(string)

new_client

XuAPI
pub fn new_client(endpoint string, user string, pass string, db string) Neo4jClient

用途

构造 client。

参数

endpoint string
endpoint(string)
user string
user(string)
pass string
pass(string)
db string
db(string)

返回

Neo4jClient — 该类型的值

(Neo4jClient) execute

XuAPI
pub fn (c Neo4jClient) execute(stmt string) string

用途

在 `Neo4jClient` 上调用 `execute`。失败时 throw。

参数

c Neo4jClient
接收者 Neo4jClient(值接收者)
stmt string
stmt(string)

返回

string — 结果字符串

(Neo4jClient) execute_on_fd

XuAPI
pub fn (c Neo4jClient) execute_on_fd(fd int, stmt string, keep_alive bool) string

用途

`Neo4jClient` 上的方法:execute于fd。失败时 throw。

参数

c Neo4jClient
接收者 Neo4jClient(值接收者)
fd int
文件描述符(int)
stmt string
stmt(string)
keep_alive bool
keep_alive(bool)

返回

string — 结果字符串

struct Pool

XuAPI
pub struct Pool {
    pub client Neo4jClient
    pub state chan pool.State
    pub max_idle int
}

用途

公开结构体 `Pool`。

参数

client Neo4jClient
字段(Neo4jClient)
state chan pool.State
字段(通道;类型 chan pool.State)
max_idle int
字段(int)

new_pool

XuAPI
pub fn new_pool(endpoint string, user string, pass string, db string, max_idle int) Pool

用途

构造 pool。

参数

endpoint string
endpoint(string)
user string
user(string)
pass string
pass(string)
db string
db(string)
max_idle int
max_idle(int)

返回

Pool — 该类型的值

(&Pool) dup

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

用途

在 `&Pool` 上调用 `dup`。

参数

p &Pool
接收者 &Pool(借用)

返回

Pool — 该类型的值

(&Pool) get_conn

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

用途

`&Pool` 上的方法:读取 conn。

参数

p &Pool
接收者 &Pool(借用)

返回

int — 该类型的值

(&Pool) put_conn

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

用途

`&Pool` 上的方法:put连接。

参数

p &Pool
接收者 &Pool(借用)
fd int
文件描述符(int)

(&Pool) discard_conn

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

用途

`&Pool` 上的方法:丢弃连接。

参数

p &Pool
接收者 &Pool(借用)
fd int
文件描述符(int)

open_pool

XuAPI
pub fn open_pool(endpoint string, user string, pass string, db string, max_idle int) Pool

用途

打开pool。

参数

endpoint string
endpoint(string)
user string
user(string)
pass string
pass(string)
db string
db(string)
max_idle int
max_idle(int)

返回

Pool — 该类型的值

(&Pool) execute

XuAPI
pub fn (p &Pool) execute(stmt string) string

用途

在 `&Pool` 上调用 `execute`。失败时 throw。

参数

p &Pool
接收者 &Pool(借用)
stmt string
stmt(string)

返回

string — 结果字符串

(&Pool) close

XuAPI
pub fn (p &Pool) close()

用途

`&Pool` 上的方法:关闭资源。

参数

p &Pool
接收者 &Pool(借用)