Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterOnebotApiCqhttpGRPCServiceServer(s *grpc.Server, srv OnebotApiCqhttpGRPCServiceServer)
- type ChannelApiCqhttpClient
- func (cli *ChannelApiCqhttpClient) CheckUrlSafely(url string) (*model.CheckUrlSafelyResult, error)
- func (cli *ChannelApiCqhttpClient) CleanCache() error
- func (cli *ChannelApiCqhttpClient) DownloadFile(url string, threadCount int32, headers []string) (*model.DownloadFileResult, error)
- func (cli *ChannelApiCqhttpClient) GetCookies(domain string) (*model.CookiesResult, error)
- func (cli *ChannelApiCqhttpClient) GetCredentials() (*model.CredentialsResult, error)
- func (cli *ChannelApiCqhttpClient) GetCsrfToken() (*model.CsrfTokenResult, error)
- func (cli *ChannelApiCqhttpClient) GetStatus() (*model.StatusResult, error)
- func (cli *ChannelApiCqhttpClient) GetVersionInfo() (*model.VersionInfoResult, error)
- func (cli *ChannelApiCqhttpClient) HiddenGetWordSlices(content string) (*model.WordSlicesResult, error)
- func (cli *ChannelApiCqhttpClient) HiddenHandleQuickOperation(context interface{}, operation interface{}) error
- func (cli *ChannelApiCqhttpClient) ReloadEventFilter(file string) error
- func (cli *ChannelApiCqhttpClient) SetRestart(delay int32) error
- type DownloadFileRequestGRPC
- func (*DownloadFileRequestGRPC) Descriptor() ([]byte, []int)deprecated
- func (x *DownloadFileRequestGRPC) GetHeaders() []string
- func (x *DownloadFileRequestGRPC) GetThreadCount() int32
- func (x *DownloadFileRequestGRPC) GetUrl() string
- func (*DownloadFileRequestGRPC) ProtoMessage()
- func (x *DownloadFileRequestGRPC) ProtoReflect() protoreflect.Message
- func (x *DownloadFileRequestGRPC) Reset()
- func (x *DownloadFileRequestGRPC) String() string
- type HiddenHandleQuickOperationRequestGRPC
- func (*HiddenHandleQuickOperationRequestGRPC) Descriptor() ([]byte, []int)deprecated
- func (x *HiddenHandleQuickOperationRequestGRPC) GetContext() *anypb.Any
- func (x *HiddenHandleQuickOperationRequestGRPC) GetOperation() *anypb.Any
- func (*HiddenHandleQuickOperationRequestGRPC) ProtoMessage()
- func (x *HiddenHandleQuickOperationRequestGRPC) ProtoReflect() protoreflect.Message
- func (x *HiddenHandleQuickOperationRequestGRPC) Reset()
- func (x *HiddenHandleQuickOperationRequestGRPC) String() string
- type OnebotApiCqhttpClient
- type OnebotApiCqhttpGRPCServiceClient
- type OnebotApiCqhttpGRPCServiceServer
- type UnimplementedOnebotApiCqhttpGRPCServiceServer
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) CheckUrlSafely(context.Context, *wrapperspb.StringValue) (*model.CheckUrlSafelyResultGRPC, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) CleanCache(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) DownloadFile(context.Context, *DownloadFileRequestGRPC) (*model.DownloadFileResultGRPC, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCookies(context.Context, *wrapperspb.StringValue) (*model.CookiesResultGRPC, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCredentials(context.Context, *emptypb.Empty) (*model.CredentialsResultGRPC, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCsrfToken(context.Context, *emptypb.Empty) (*model.CsrfTokenResultGRPC, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetStatus(context.Context, *emptypb.Empty) (*model.StatusResultGRPC, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetVersionInfo(context.Context, *emptypb.Empty) (*model.VersionInfoResultGRPC, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) HiddenGetWordSlices(context.Context, *wrapperspb.StringValue) (*model.WordSlicesResultGRPC, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) HiddenHandleQuickOperation(context.Context, *HiddenHandleQuickOperationRequestGRPC) (*emptypb.Empty, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) ReloadEventFilter(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
- func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) SetRestart(context.Context, *wrapperspb.Int32Value) (*emptypb.Empty, error)
Constants ¶
const ( API_GET_COOKIES = "get_cookies" API_GET_CSRF_TOKEN = "get_csrf_token" API_GET_CREDENTIALS = "get_credentials" API_GET_VERSION_INFO = "get_version_info" API_GET_STATUS = "get_status" API_SET_RESTART = "set_restart" API_CLEAN_CACHE = "clean_cache" API_RELOAD_EVENT_FILTER = "reload_event_filter" API_DOWNLOAD_FILE = "download_file" API_CHECK_URL_SAFELY = "check_url_safely" API_HIDDEN_GET_WORD_SLICES = ".get_word_slices" API_HIDDEN_HANDLE_QUICK_OPERATION = ".handle_quick_operation" )
type OnebotApiCqhttp interface { // 获取 CSRF Token // get_csrf_token GetCsrfToken() (*model.CsrfTokenResult, error) // 获取 QQ 相关接口凭证 // get_credentials GetCredentials() (*model.CredentialsResult, error) // 获取版本信息 // get_version_info GetVersionInfo() (*model.VersionInfoResult, error) // 获取状态 // get_status GetStatus() (*model.StatusResult, error) // 重启 Go-CqHttp // set_restart // delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右 SetRestart(delay int32) error // 清理缓存 // clean_cache CleanCache() error // 重载事件过滤器 // reload_event_filter // file 事件过滤器文件路径 ReloadEventFilter(file string) error // 下载文件到缓存目录 // download_file // url 文件链接 // thread_count 线程数 // headers 请求头 DownloadFile(url string, threadCount int32, headers []string) (*model.DownloadFileResult, error) // 检查链接安全性 // check_url_safely // url 链接 CheckUrlSafely(url string) (*model.CheckUrlSafelyResult, error) // 获取中文分词 ( 隐藏 API ) // .get_word_slices // content 内容 HiddenGetWordSlices(content string) (*model.WordSlicesResult, error) // 对事件执行快速操作 ( 隐藏 API ) // .handle_quick_operation // context 事件上下文 // operation 操作 HiddenHandleQuickOperation(context interface{}, operation interface{}) error }
Variables ¶
var File_api_cqhttp_proto protoreflect.FileDescriptor
Functions ¶
func RegisterOnebotApiCqhttpGRPCServiceServer ¶
func RegisterOnebotApiCqhttpGRPCServiceServer(s *grpc.Server, srv OnebotApiCqhttpGRPCServiceServer)
Types ¶
type ChannelApiCqhttpClient ¶
type ChannelApiCqhttpClient struct {
channel.ApiChannel
}
func (*ChannelApiCqhttpClient) CheckUrlSafely ¶
func (cli *ChannelApiCqhttpClient) CheckUrlSafely(url string) (*model.CheckUrlSafelyResult, error)
检查链接安全性 check_url_safely url 链接
func (*ChannelApiCqhttpClient) CleanCache ¶
func (cli *ChannelApiCqhttpClient) CleanCache() error
清理缓存 clean_cache
func (*ChannelApiCqhttpClient) DownloadFile ¶
func (cli *ChannelApiCqhttpClient) DownloadFile(url string, threadCount int32, headers []string) (*model.DownloadFileResult, error)
下载文件到缓存目录 download_file url 文件链接 thread_count 线程数 headers 请求头
func (*ChannelApiCqhttpClient) GetCookies ¶
func (cli *ChannelApiCqhttpClient) GetCookies(domain string) (*model.CookiesResult, error)
获取 Cookies get_cookies domain 指定域名
func (*ChannelApiCqhttpClient) GetCredentials ¶
func (cli *ChannelApiCqhttpClient) GetCredentials() (*model.CredentialsResult, error)
获取 QQ 相关接口凭证 get_credentials
func (*ChannelApiCqhttpClient) GetCsrfToken ¶
func (cli *ChannelApiCqhttpClient) GetCsrfToken() (*model.CsrfTokenResult, error)
获取 CSRF Token get_csrf_token
func (*ChannelApiCqhttpClient) GetStatus ¶
func (cli *ChannelApiCqhttpClient) GetStatus() (*model.StatusResult, error)
获取状态 get_status
func (*ChannelApiCqhttpClient) GetVersionInfo ¶
func (cli *ChannelApiCqhttpClient) GetVersionInfo() (*model.VersionInfoResult, error)
获取版本信息 get_version_info
func (*ChannelApiCqhttpClient) HiddenGetWordSlices ¶
func (cli *ChannelApiCqhttpClient) HiddenGetWordSlices(content string) (*model.WordSlicesResult, error)
获取中文分词 ( 隐藏 API ) .get_word_slices content 内容
func (*ChannelApiCqhttpClient) HiddenHandleQuickOperation ¶
func (cli *ChannelApiCqhttpClient) HiddenHandleQuickOperation(context interface{}, operation interface{}) error
对事件执行快速操作 ( 隐藏 API ) .handle_quick_operation context 事件上下文 operation 操作
func (*ChannelApiCqhttpClient) ReloadEventFilter ¶
func (cli *ChannelApiCqhttpClient) ReloadEventFilter(file string) error
重载事件过滤器 reload_event_filter file 事件过滤器文件路径
func (*ChannelApiCqhttpClient) SetRestart ¶
func (cli *ChannelApiCqhttpClient) SetRestart(delay int32) error
重启 Go-CqHttp set_restart delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右
type DownloadFileRequestGRPC ¶
type DownloadFileRequestGRPC struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` ThreadCount int32 `protobuf:"varint,2,opt,name=thread_count,json=threadCount,proto3" json:"thread_count,omitempty"` Headers []string `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"` // contains filtered or unexported fields }
func (*DownloadFileRequestGRPC) Descriptor
deprecated
func (*DownloadFileRequestGRPC) Descriptor() ([]byte, []int)
Deprecated: Use DownloadFileRequestGRPC.ProtoReflect.Descriptor instead.
func (*DownloadFileRequestGRPC) GetHeaders ¶
func (x *DownloadFileRequestGRPC) GetHeaders() []string
func (*DownloadFileRequestGRPC) GetThreadCount ¶
func (x *DownloadFileRequestGRPC) GetThreadCount() int32
func (*DownloadFileRequestGRPC) GetUrl ¶
func (x *DownloadFileRequestGRPC) GetUrl() string
func (*DownloadFileRequestGRPC) ProtoMessage ¶
func (*DownloadFileRequestGRPC) ProtoMessage()
func (*DownloadFileRequestGRPC) ProtoReflect ¶
func (x *DownloadFileRequestGRPC) ProtoReflect() protoreflect.Message
func (*DownloadFileRequestGRPC) Reset ¶
func (x *DownloadFileRequestGRPC) Reset()
func (*DownloadFileRequestGRPC) String ¶
func (x *DownloadFileRequestGRPC) String() string
type HiddenHandleQuickOperationRequestGRPC ¶
type HiddenHandleQuickOperationRequestGRPC struct { Context *anypb.Any `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"` Operation *anypb.Any `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"` // contains filtered or unexported fields }
func (*HiddenHandleQuickOperationRequestGRPC) Descriptor
deprecated
func (*HiddenHandleQuickOperationRequestGRPC) Descriptor() ([]byte, []int)
Deprecated: Use HiddenHandleQuickOperationRequestGRPC.ProtoReflect.Descriptor instead.
func (*HiddenHandleQuickOperationRequestGRPC) GetContext ¶
func (x *HiddenHandleQuickOperationRequestGRPC) GetContext() *anypb.Any
func (*HiddenHandleQuickOperationRequestGRPC) GetOperation ¶
func (x *HiddenHandleQuickOperationRequestGRPC) GetOperation() *anypb.Any
func (*HiddenHandleQuickOperationRequestGRPC) ProtoMessage ¶
func (*HiddenHandleQuickOperationRequestGRPC) ProtoMessage()
func (*HiddenHandleQuickOperationRequestGRPC) ProtoReflect ¶
func (x *HiddenHandleQuickOperationRequestGRPC) ProtoReflect() protoreflect.Message
func (*HiddenHandleQuickOperationRequestGRPC) Reset ¶
func (x *HiddenHandleQuickOperationRequestGRPC) Reset()
func (*HiddenHandleQuickOperationRequestGRPC) String ¶
func (x *HiddenHandleQuickOperationRequestGRPC) String() string
type OnebotApiCqhttpClient ¶
type OnebotApiCqhttpClient interface { // 获取 Cookies // get_cookies // domain 指定域名 GetCookies(domain string) (*model.CookiesResult, error) // 获取 CSRF Token // get_csrf_token GetCsrfToken() (*model.CsrfTokenResult, error) // 获取 QQ 相关接口凭证 // get_credentials GetCredentials() (*model.CredentialsResult, error) // 获取版本信息 // get_version_info GetVersionInfo() (*model.VersionInfoResult, error) // 获取状态 // get_status GetStatus() (*model.StatusResult, error) // 重启 Go-CqHttp // set_restart // delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右 SetRestart(delay int32) error // 清理缓存 // clean_cache CleanCache() error // 重载事件过滤器 // reload_event_filter // file 事件过滤器文件路径 ReloadEventFilter(file string) error // 下载文件到缓存目录 // download_file // url 文件链接 // thread_count 线程数 // headers 请求头 DownloadFile(url string, threadCount int32, headers []string) (*model.DownloadFileResult, error) // 检查链接安全性 // check_url_safely // url 链接 CheckUrlSafely(url string) (*model.CheckUrlSafelyResult, error) // 获取中文分词 ( 隐藏 API ) // .get_word_slices // content 内容 HiddenGetWordSlices(content string) (*model.WordSlicesResult, error) // 对事件执行快速操作 ( 隐藏 API ) // .handle_quick_operation // context 事件上下文 // operation 操作 HiddenHandleQuickOperation(context interface{}, operation interface{}) error }
func NewChannelApiCqhttpClient ¶
func NewChannelApiCqhttpClient(channel channel.ApiChannel) (OnebotApiCqhttpClient, error)
type OnebotApiCqhttpGRPCServiceClient ¶
type OnebotApiCqhttpGRPCServiceClient interface { // 获取 Cookies // get_cookies // domain 指定域名 GetCookies(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*model.CookiesResultGRPC, error) // get_csrf_token GetCsrfToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*model.CsrfTokenResultGRPC, error) // 获取 QQ 相关接口凭证 // get_credentials GetCredentials(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*model.CredentialsResultGRPC, error) // 获取版本信息 // get_version_info GetVersionInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*model.VersionInfoResultGRPC, error) // 获取状态 // get_status GetStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*model.StatusResultGRPC, error) // 重启 Go-CqHttp // set_restart // delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右 SetRestart(ctx context.Context, in *wrapperspb.Int32Value, opts ...grpc.CallOption) (*emptypb.Empty, error) // 清理缓存 // clean_cache CleanCache(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) // 重载事件过滤器 // reload_event_filter // file 事件过滤器文件路径 ReloadEventFilter(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*emptypb.Empty, error) // 下载文件到缓存目录 // download_file // url 文件链接 // thread_count 线程数 // headers 请求头 DownloadFile(ctx context.Context, in *DownloadFileRequestGRPC, opts ...grpc.CallOption) (*model.DownloadFileResultGRPC, error) // 检查链接安全性 // check_url_safely // url 链接 CheckUrlSafely(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*model.CheckUrlSafelyResultGRPC, error) // 获取中文分词 ( 隐藏 API ) // .get_word_slices // content 内容 HiddenGetWordSlices(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*model.WordSlicesResultGRPC, error) // 对事件执行快速操作 ( 隐藏 API ) // .handle_quick_operation // context 事件上下文 // operation 操作 HiddenHandleQuickOperation(ctx context.Context, in *HiddenHandleQuickOperationRequestGRPC, opts ...grpc.CallOption) (*emptypb.Empty, error) }
OnebotApiCqhttpGRPCServiceClient is the client API for OnebotApiCqhttpGRPCService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewOnebotApiCqhttpGRPCServiceClient ¶
func NewOnebotApiCqhttpGRPCServiceClient(cc grpc.ClientConnInterface) OnebotApiCqhttpGRPCServiceClient
type OnebotApiCqhttpGRPCServiceServer ¶
type OnebotApiCqhttpGRPCServiceServer interface { // 获取 Cookies // get_cookies // domain 指定域名 GetCookies(context.Context, *wrapperspb.StringValue) (*model.CookiesResultGRPC, error) // get_csrf_token GetCsrfToken(context.Context, *emptypb.Empty) (*model.CsrfTokenResultGRPC, error) // 获取 QQ 相关接口凭证 // get_credentials GetCredentials(context.Context, *emptypb.Empty) (*model.CredentialsResultGRPC, error) // 获取版本信息 // get_version_info GetVersionInfo(context.Context, *emptypb.Empty) (*model.VersionInfoResultGRPC, error) // 获取状态 // get_status GetStatus(context.Context, *emptypb.Empty) (*model.StatusResultGRPC, error) // 重启 Go-CqHttp // set_restart // delay 要延迟的毫秒数, 如果默认情况下无法重启, 可以尝试设置延迟为 2000 左右 SetRestart(context.Context, *wrapperspb.Int32Value) (*emptypb.Empty, error) // 清理缓存 // clean_cache CleanCache(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // 重载事件过滤器 // reload_event_filter // file 事件过滤器文件路径 ReloadEventFilter(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error) // 下载文件到缓存目录 // download_file // url 文件链接 // thread_count 线程数 // headers 请求头 DownloadFile(context.Context, *DownloadFileRequestGRPC) (*model.DownloadFileResultGRPC, error) // 检查链接安全性 // check_url_safely // url 链接 CheckUrlSafely(context.Context, *wrapperspb.StringValue) (*model.CheckUrlSafelyResultGRPC, error) // 获取中文分词 ( 隐藏 API ) // .get_word_slices // content 内容 HiddenGetWordSlices(context.Context, *wrapperspb.StringValue) (*model.WordSlicesResultGRPC, error) // 对事件执行快速操作 ( 隐藏 API ) // .handle_quick_operation // context 事件上下文 // operation 操作 HiddenHandleQuickOperation(context.Context, *HiddenHandleQuickOperationRequestGRPC) (*emptypb.Empty, error) }
OnebotApiCqhttpGRPCServiceServer is the server API for OnebotApiCqhttpGRPCService service.
type UnimplementedOnebotApiCqhttpGRPCServiceServer ¶
type UnimplementedOnebotApiCqhttpGRPCServiceServer struct { }
UnimplementedOnebotApiCqhttpGRPCServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) CheckUrlSafely ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) CheckUrlSafely(context.Context, *wrapperspb.StringValue) (*model.CheckUrlSafelyResultGRPC, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) CleanCache ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) DownloadFile ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) DownloadFile(context.Context, *DownloadFileRequestGRPC) (*model.DownloadFileResultGRPC, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCookies ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCookies(context.Context, *wrapperspb.StringValue) (*model.CookiesResultGRPC, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCredentials ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCredentials(context.Context, *emptypb.Empty) (*model.CredentialsResultGRPC, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCsrfToken ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetCsrfToken(context.Context, *emptypb.Empty) (*model.CsrfTokenResultGRPC, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetStatus ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetStatus(context.Context, *emptypb.Empty) (*model.StatusResultGRPC, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetVersionInfo ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) GetVersionInfo(context.Context, *emptypb.Empty) (*model.VersionInfoResultGRPC, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) HiddenGetWordSlices ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) HiddenGetWordSlices(context.Context, *wrapperspb.StringValue) (*model.WordSlicesResultGRPC, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) HiddenHandleQuickOperation ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) HiddenHandleQuickOperation(context.Context, *HiddenHandleQuickOperationRequestGRPC) (*emptypb.Empty, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) ReloadEventFilter ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) ReloadEventFilter(context.Context, *wrapperspb.StringValue) (*emptypb.Empty, error)
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) SetRestart ¶
func (*UnimplementedOnebotApiCqhttpGRPCServiceServer) SetRestart(context.Context, *wrapperspb.Int32Value) (*emptypb.Empty, error)