接口定义
CreateUser() 接口用于自定义用户名。
CreateUser(ctx context.Context, param CreateUserParams) error
使用示例
import ("context""log""github.com/tencent/vectordatabase-sdk-go/tcvectordb""github.com/tencent/vectordatabase-sdk-go/tcvectordb/api/user")var (ctx = context.Background())err := client.CreateUser(ctx, tcvectordb.CreateUserParams{User: "app_user", Password: "**********"})if err != nil {log.Printf("create user failed, err: %+v", err.Error())}
入参描述
参数名 | 参数含义 | 数据类型 | 是否必填 | 默认值 | 参数配置 |
User | 自定义用户名 | string | 是 | - | 长度要求:1~32字符。 字符类型要求:只能使用英文字母(大写 A~Z、小写 a~z)、数字(0~9)、下划线(_),并以英文字母开头。 |
Password | 设置密码 | string | 是 | - | 密码长度要求:8~128字符。 密码设置支持如下类型的任意组合。 字母:大写 A~Z、小写 a~z。 数字:0~9。 特殊符号包括:下划线(_)、加号(+)、减号(-)、逗号(,)、和号(&)、等号(=)、感叹号(!)、@符号(@)、井号(#)、美元符号($)、百分号(%)、脱字符(^)、星号(*)、圆括号(())、点号(.)。 |