base

package
v0.0.0-...-b9f283a Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_plus_base_proto protoreflect.FileDescriptor

Functions

func RegisterOnebotPluginBaseGRPCServer

func RegisterOnebotPluginBaseGRPCServer(s *grpc.Server, srv OnebotPluginBaseGRPCServer)

Types

type OnebotPluginBase

type OnebotPluginBase interface {
	// 插件Id
	Id() string
	// 插件名称
	Name() string
	// 插件描述
	Description() string
	// 插件帮助
	Help() string
	// 生命周期
	Init(cli api.OnebotApiClientInterface) error
	// 退出前
	BeforeExit(cli api.OnebotApiClientInterface) error
}

type OnebotPluginBaseClientStub

type OnebotPluginBaseClientStub struct {
	Broker *plugin.GRPCBroker
	Client OnebotPluginBaseGRPCClient
}

func (*OnebotPluginBaseClientStub) BeforeExit

退出前

func (*OnebotPluginBaseClientStub) Description

func (c *OnebotPluginBaseClientStub) Description() string

插件描述

func (*OnebotPluginBaseClientStub) Help

插件帮助

func (*OnebotPluginBaseClientStub) Id

插件Id

func (*OnebotPluginBaseClientStub) Init

生命周期

func (*OnebotPluginBaseClientStub) Name

插件名称

type OnebotPluginBaseGRPCClient

type OnebotPluginBaseGRPCClient interface {
	Id(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
	Name(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
	Description(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
	Help(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
	Init(ctx context.Context, in *wrapperspb.UInt32Value, opts ...grpc.CallOption) (*emptypb.Empty, error)
	BeforeExit(ctx context.Context, in *wrapperspb.UInt32Value, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

OnebotPluginBaseGRPCClient is the client API for OnebotPluginBaseGRPC service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type OnebotPluginBaseGRPCServer

OnebotPluginBaseGRPCServer is the server API for OnebotPluginBaseGRPC service.

type OnebotPluginBaseServerStub

type OnebotPluginBaseServerStub struct {
	Broker *plugin.GRPCBroker
	Impl   OnebotPluginBase
}

func (*OnebotPluginBaseServerStub) BeforeExit

func (*OnebotPluginBaseServerStub) Description

func (*OnebotPluginBaseServerStub) Help

func (*OnebotPluginBaseServerStub) Id

func (*OnebotPluginBaseServerStub) Init

func (*OnebotPluginBaseServerStub) Name

type UnimplementedOnebotPluginBaseGRPCServer

type UnimplementedOnebotPluginBaseGRPCServer struct {
}

UnimplementedOnebotPluginBaseGRPCServer can be embedded to have forward compatible implementations.

func (*UnimplementedOnebotPluginBaseGRPCServer) BeforeExit

func (*UnimplementedOnebotPluginBaseGRPCServer) Description

func (*UnimplementedOnebotPluginBaseGRPCServer) Help

func (*UnimplementedOnebotPluginBaseGRPCServer) Id

func (*UnimplementedOnebotPluginBaseGRPCServer) Init

func (*UnimplementedOnebotPluginBaseGRPCServer) Name

Jump to

Keyboard shortcuts

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