Documentation
¶
Index ¶
- Variables
- func ConvertFromRPCHeaders(headers []*HttpHeader) http.Header
- func ConvertRPCToHTTP(r *HttpRequest) *http.Request
- func CtxWithToken(ctx context.Context, scheme string, token string) context.Context
- func CtxWithTokenAndPath(ctx context.Context, scheme string, token string, path string) context.Context
- func NewHttpServer(port int, plugin []Plugin, logger irc.Logger) *httpServer
- func RegisterHTTPPluginServer(s grpc.ServiceRegistrar, srv HTTPPluginServer)
- func RegisterIRCPluginServer(s grpc.ServiceRegistrar, srv IRCPluginServer)
- type Channel
- type ChannelList
- type ChannelMessage
- func (*ChannelMessage) Descriptor() ([]byte, []int)deprecated
- func (x *ChannelMessage) GetChannel() string
- func (x *ChannelMessage) GetMessage() string
- func (x *ChannelMessage) GetSource() string
- func (x *ChannelMessage) GetTags() map[string]string
- func (*ChannelMessage) ProtoMessage()
- func (x *ChannelMessage) ProtoReflect() protoreflect.Message
- func (x *ChannelMessage) Reset()
- func (x *ChannelMessage) String() string
- type Empty
- type Error
- type GrpcServer
- type HTTPPluginClient
- type HTTPPluginServer
- type HTTPPlugin_GetRequestClient
- type HTTPPlugin_GetRequestServer
- type HttpHeader
- type HttpRequest
- func (*HttpRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HttpRequest) GetBody() []byte
- func (x *HttpRequest) GetHeader() []*HttpHeader
- func (x *HttpRequest) GetMethod() string
- func (x *HttpRequest) GetPath() string
- func (*HttpRequest) ProtoMessage()
- func (x *HttpRequest) ProtoReflect() protoreflect.Message
- func (x *HttpRequest) Reset()
- func (x *HttpRequest) String() string
- type HttpResponse
- func (*HttpResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HttpResponse) GetBody() []byte
- func (x *HttpResponse) GetHeader() []*HttpHeader
- func (x *HttpResponse) GetStatus() int32
- func (*HttpResponse) ProtoMessage()
- func (x *HttpResponse) ProtoReflect() protoreflect.Message
- func (x *HttpResponse) Reset()
- func (x *HttpResponse) String() string
- type IRCFunctions
- type IRCPluginClient
- type IRCPluginServer
- type IRCPlugin_GetMessagesClient
- type IRCPlugin_GetMessagesServer
- type IRCSender
- type Plugin
- type RawMessage
- type RelayMessage
- func (*RelayMessage) Descriptor() ([]byte, []int)deprecated
- func (x *RelayMessage) GetChannel() string
- func (x *RelayMessage) GetMessage() string
- func (x *RelayMessage) GetNick() string
- func (x *RelayMessage) GetTags() map[string]string
- func (*RelayMessage) ProtoMessage()
- func (x *RelayMessage) ProtoReflect() protoreflect.Message
- func (x *RelayMessage) Reset()
- func (x *RelayMessage) String() string
- type Route
- type UnimplementedHTTPPluginServer
- type UnimplementedIRCPluginServer
- func (UnimplementedIRCPluginServer) GetMessages(*Channel, IRCPlugin_GetMessagesServer) error
- func (UnimplementedIRCPluginServer) JoinChannel(context.Context, *Channel) (*Error, error)
- func (UnimplementedIRCPluginServer) LeaveChannel(context.Context, *Channel) (*Error, error)
- func (UnimplementedIRCPluginServer) ListChannel(context.Context, *Empty) (*ChannelList, error)
- func (UnimplementedIRCPluginServer) Ping(context.Context, *Empty) (*Empty, error)
- func (UnimplementedIRCPluginServer) SendChannelMessage(context.Context, *ChannelMessage) (*Error, error)
- func (UnimplementedIRCPluginServer) SendRawMessage(context.Context, *RawMessage) (*Error, error)
- func (UnimplementedIRCPluginServer) SendRelayMessage(context.Context, *RelayMessage) (*Error, error)
- type UnsafeHTTPPluginServer
- type UnsafeIRCPluginServer
Constants ¶
This section is empty.
Variables ¶
var File_plugin_proto protoreflect.FileDescriptor
var HTTPPlugin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpc.HTTPPlugin", HandlerType: (*HTTPPluginServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "getRequest", Handler: _HTTPPlugin_GetRequest_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "plugin.proto", }
HTTPPlugin_ServiceDesc is the grpc.ServiceDesc for HTTPPlugin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var IRCPlugin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpc.IRCPlugin", HandlerType: (*IRCPluginServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ping", Handler: _IRCPlugin_Ping_Handler, }, { MethodName: "sendChannelMessage", Handler: _IRCPlugin_SendChannelMessage_Handler, }, { MethodName: "sendRelayMessage", Handler: _IRCPlugin_SendRelayMessage_Handler, }, { MethodName: "sendRawMessage", Handler: _IRCPlugin_SendRawMessage_Handler, }, { MethodName: "joinChannel", Handler: _IRCPlugin_JoinChannel_Handler, }, { MethodName: "leaveChannel", Handler: _IRCPlugin_LeaveChannel_Handler, }, { MethodName: "listChannel", Handler: _IRCPlugin_ListChannel_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "getMessages", Handler: _IRCPlugin_GetMessages_Handler, ServerStreams: true, }, }, Metadata: "plugin.proto", }
IRCPlugin_ServiceDesc is the grpc.ServiceDesc for IRCPlugin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func ConvertFromRPCHeaders ¶
func ConvertFromRPCHeaders(headers []*HttpHeader) http.Header
func ConvertRPCToHTTP ¶
func ConvertRPCToHTTP(r *HttpRequest) *http.Request
func CtxWithToken ¶
func CtxWithTokenAndPath ¶
func RegisterHTTPPluginServer ¶
func RegisterHTTPPluginServer(s grpc.ServiceRegistrar, srv HTTPPluginServer)
func RegisterIRCPluginServer ¶
func RegisterIRCPluginServer(s grpc.ServiceRegistrar, srv IRCPluginServer)
Types ¶
type Channel ¶
type Channel struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Channel) Descriptor
deprecated
func (*Channel) ProtoMessage ¶
func (*Channel) ProtoMessage()
func (*Channel) ProtoReflect ¶
func (x *Channel) ProtoReflect() protoreflect.Message
type ChannelList ¶
type ChannelList struct { Name []string `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*ChannelList) Descriptor
deprecated
func (*ChannelList) Descriptor() ([]byte, []int)
Deprecated: Use ChannelList.ProtoReflect.Descriptor instead.
func (*ChannelList) GetName ¶
func (x *ChannelList) GetName() []string
func (*ChannelList) ProtoMessage ¶
func (*ChannelList) ProtoMessage()
func (*ChannelList) ProtoReflect ¶
func (x *ChannelList) ProtoReflect() protoreflect.Message
func (*ChannelList) Reset ¶
func (x *ChannelList) Reset()
func (*ChannelList) String ¶
func (x *ChannelList) String() string
type ChannelMessage ¶
type ChannelMessage struct { Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` Tags map[string]string `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
func (*ChannelMessage) Descriptor
deprecated
func (*ChannelMessage) Descriptor() ([]byte, []int)
Deprecated: Use ChannelMessage.ProtoReflect.Descriptor instead.
func (*ChannelMessage) GetChannel ¶
func (x *ChannelMessage) GetChannel() string
func (*ChannelMessage) GetMessage ¶
func (x *ChannelMessage) GetMessage() string
func (*ChannelMessage) GetSource ¶
func (x *ChannelMessage) GetSource() string
func (*ChannelMessage) GetTags ¶
func (x *ChannelMessage) GetTags() map[string]string
func (*ChannelMessage) ProtoMessage ¶
func (*ChannelMessage) ProtoMessage()
func (*ChannelMessage) ProtoReflect ¶
func (x *ChannelMessage) ProtoReflect() protoreflect.Message
func (*ChannelMessage) Reset ¶
func (x *ChannelMessage) Reset()
func (*ChannelMessage) String ¶
func (x *ChannelMessage) String() string
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type Error ¶
type Error struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type GrpcServer ¶
type GrpcServer struct {
// contains filtered or unexported fields
}
func NewGrpcServer ¶
func (*GrpcServer) StartGRPC ¶
func (s *GrpcServer) StartGRPC(bot *bot.Bot)
type HTTPPluginClient ¶
type HTTPPluginClient interface {
GetRequest(ctx context.Context, opts ...grpc.CallOption) (HTTPPlugin_GetRequestClient, error)
}
HTTPPluginClient is the client API for HTTPPlugin service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewHTTPPluginClient ¶
func NewHTTPPluginClient(cc grpc.ClientConnInterface) HTTPPluginClient
type HTTPPluginServer ¶
type HTTPPluginServer interface { GetRequest(HTTPPlugin_GetRequestServer) error // contains filtered or unexported methods }
HTTPPluginServer is the server API for HTTPPlugin service. All implementations must embed UnimplementedHTTPPluginServer for forward compatibility
type HTTPPlugin_GetRequestClient ¶
type HTTPPlugin_GetRequestClient interface { Send(*HttpResponse) error Recv() (*HttpRequest, error) grpc.ClientStream }
type HTTPPlugin_GetRequestServer ¶
type HTTPPlugin_GetRequestServer interface { Send(*HttpRequest) error Recv() (*HttpResponse, error) grpc.ServerStream }
type HttpHeader ¶
type HttpHeader struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func ConvertToRPCHeaders ¶
func ConvertToRPCHeaders(headers http.Header) []*HttpHeader
func (*HttpHeader) Descriptor
deprecated
func (*HttpHeader) Descriptor() ([]byte, []int)
Deprecated: Use HttpHeader.ProtoReflect.Descriptor instead.
func (*HttpHeader) GetKey ¶
func (x *HttpHeader) GetKey() string
func (*HttpHeader) GetValue ¶
func (x *HttpHeader) GetValue() string
func (*HttpHeader) ProtoMessage ¶
func (*HttpHeader) ProtoMessage()
func (*HttpHeader) ProtoReflect ¶
func (x *HttpHeader) ProtoReflect() protoreflect.Message
func (*HttpHeader) Reset ¶
func (x *HttpHeader) Reset()
func (*HttpHeader) String ¶
func (x *HttpHeader) String() string
type HttpRequest ¶
type HttpRequest struct { Header []*HttpHeader `protobuf:"bytes,1,rep,name=header,proto3" json:"header,omitempty"` Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` Method string `protobuf:"bytes,4,opt,name=method,proto3" json:"method,omitempty"` // contains filtered or unexported fields }
func ConvertHTTPToRPC ¶
func ConvertHTTPToRPC(r *http.Request) (*HttpRequest, error)
func (*HttpRequest) Descriptor
deprecated
func (*HttpRequest) Descriptor() ([]byte, []int)
Deprecated: Use HttpRequest.ProtoReflect.Descriptor instead.
func (*HttpRequest) GetBody ¶
func (x *HttpRequest) GetBody() []byte
func (*HttpRequest) GetHeader ¶
func (x *HttpRequest) GetHeader() []*HttpHeader
func (*HttpRequest) GetMethod ¶
func (x *HttpRequest) GetMethod() string
func (*HttpRequest) GetPath ¶
func (x *HttpRequest) GetPath() string
func (*HttpRequest) ProtoMessage ¶
func (*HttpRequest) ProtoMessage()
func (*HttpRequest) ProtoReflect ¶
func (x *HttpRequest) ProtoReflect() protoreflect.Message
func (*HttpRequest) Reset ¶
func (x *HttpRequest) Reset()
func (*HttpRequest) String ¶
func (x *HttpRequest) String() string
type HttpResponse ¶
type HttpResponse struct { Header []*HttpHeader `protobuf:"bytes,1,rep,name=header,proto3" json:"header,omitempty"` Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*HttpResponse) Descriptor
deprecated
func (*HttpResponse) Descriptor() ([]byte, []int)
Deprecated: Use HttpResponse.ProtoReflect.Descriptor instead.
func (*HttpResponse) GetBody ¶
func (x *HttpResponse) GetBody() []byte
func (*HttpResponse) GetHeader ¶
func (x *HttpResponse) GetHeader() []*HttpHeader
func (*HttpResponse) GetStatus ¶
func (x *HttpResponse) GetStatus() int32
func (*HttpResponse) ProtoMessage ¶
func (*HttpResponse) ProtoMessage()
func (*HttpResponse) ProtoReflect ¶
func (x *HttpResponse) ProtoReflect() protoreflect.Message
func (*HttpResponse) Reset ¶
func (x *HttpResponse) Reset()
func (*HttpResponse) String ¶
func (x *HttpResponse) String() string
type IRCFunctions ¶ added in v5.0.1
type IRCFunctions interface { GetChannels() []string CurrentNick() string RemoveCallback(id ircevent.CallbackID) AddCallback(string, func(ircmsg.Message)) ircevent.CallbackID }
type IRCPluginClient ¶
type IRCPluginClient interface { Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) SendChannelMessage(ctx context.Context, in *ChannelMessage, opts ...grpc.CallOption) (*Error, error) SendRelayMessage(ctx context.Context, in *RelayMessage, opts ...grpc.CallOption) (*Error, error) SendRawMessage(ctx context.Context, in *RawMessage, opts ...grpc.CallOption) (*Error, error) GetMessages(ctx context.Context, in *Channel, opts ...grpc.CallOption) (IRCPlugin_GetMessagesClient, error) JoinChannel(ctx context.Context, in *Channel, opts ...grpc.CallOption) (*Error, error) LeaveChannel(ctx context.Context, in *Channel, opts ...grpc.CallOption) (*Error, error) ListChannel(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChannelList, error) }
IRCPluginClient is the client API for IRCPlugin service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewIRCPluginClient ¶
func NewIRCPluginClient(cc grpc.ClientConnInterface) IRCPluginClient
type IRCPluginServer ¶
type IRCPluginServer interface { Ping(context.Context, *Empty) (*Empty, error) SendChannelMessage(context.Context, *ChannelMessage) (*Error, error) SendRelayMessage(context.Context, *RelayMessage) (*Error, error) SendRawMessage(context.Context, *RawMessage) (*Error, error) GetMessages(*Channel, IRCPlugin_GetMessagesServer) error JoinChannel(context.Context, *Channel) (*Error, error) LeaveChannel(context.Context, *Channel) (*Error, error) ListChannel(context.Context, *Empty) (*ChannelList, error) // contains filtered or unexported methods }
IRCPluginServer is the server API for IRCPlugin service. All implementations must embed UnimplementedIRCPluginServer for forward compatibility
type IRCPlugin_GetMessagesClient ¶
type IRCPlugin_GetMessagesClient interface { Recv() (*ChannelMessage, error) grpc.ClientStream }
type IRCPlugin_GetMessagesServer ¶
type IRCPlugin_GetMessagesServer interface { Send(*ChannelMessage) error grpc.ServerStream }
type Plugin ¶
func ParsePluginString ¶
type RawMessage ¶
type RawMessage struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*RawMessage) Descriptor
deprecated
func (*RawMessage) Descriptor() ([]byte, []int)
Deprecated: Use RawMessage.ProtoReflect.Descriptor instead.
func (*RawMessage) GetMessage ¶
func (x *RawMessage) GetMessage() string
func (*RawMessage) ProtoMessage ¶
func (*RawMessage) ProtoMessage()
func (*RawMessage) ProtoReflect ¶
func (x *RawMessage) ProtoReflect() protoreflect.Message
func (*RawMessage) Reset ¶
func (x *RawMessage) Reset()
func (*RawMessage) String ¶
func (x *RawMessage) String() string
type RelayMessage ¶ added in v5.0.3
type RelayMessage struct { Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` Nick string `protobuf:"bytes,2,opt,name=nick,proto3" json:"nick,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` Tags map[string]string `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
func (*RelayMessage) Descriptor
deprecated
added in
v5.0.3
func (*RelayMessage) Descriptor() ([]byte, []int)
Deprecated: Use RelayMessage.ProtoReflect.Descriptor instead.
func (*RelayMessage) GetChannel ¶ added in v5.0.3
func (x *RelayMessage) GetChannel() string
func (*RelayMessage) GetMessage ¶ added in v5.0.3
func (x *RelayMessage) GetMessage() string
func (*RelayMessage) GetNick ¶ added in v5.0.3
func (x *RelayMessage) GetNick() string
func (*RelayMessage) GetTags ¶ added in v5.0.3
func (x *RelayMessage) GetTags() map[string]string
func (*RelayMessage) ProtoMessage ¶ added in v5.0.3
func (*RelayMessage) ProtoMessage()
func (*RelayMessage) ProtoReflect ¶ added in v5.0.3
func (x *RelayMessage) ProtoReflect() protoreflect.Message
func (*RelayMessage) Reset ¶ added in v5.0.3
func (x *RelayMessage) Reset()
func (*RelayMessage) String ¶ added in v5.0.3
func (x *RelayMessage) String() string
type Route ¶
type Route struct { Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` // contains filtered or unexported fields }
func (*Route) Descriptor
deprecated
func (*Route) ProtoMessage ¶
func (*Route) ProtoMessage()
func (*Route) ProtoReflect ¶
func (x *Route) ProtoReflect() protoreflect.Message
type UnimplementedHTTPPluginServer ¶
type UnimplementedHTTPPluginServer struct { }
UnimplementedHTTPPluginServer must be embedded to have forward compatible implementations.
func (UnimplementedHTTPPluginServer) GetRequest ¶
func (UnimplementedHTTPPluginServer) GetRequest(HTTPPlugin_GetRequestServer) error
type UnimplementedIRCPluginServer ¶
type UnimplementedIRCPluginServer struct { }
UnimplementedIRCPluginServer must be embedded to have forward compatible implementations.
func (UnimplementedIRCPluginServer) GetMessages ¶
func (UnimplementedIRCPluginServer) GetMessages(*Channel, IRCPlugin_GetMessagesServer) error
func (UnimplementedIRCPluginServer) JoinChannel ¶
func (UnimplementedIRCPluginServer) LeaveChannel ¶
func (UnimplementedIRCPluginServer) ListChannel ¶
func (UnimplementedIRCPluginServer) ListChannel(context.Context, *Empty) (*ChannelList, error)
func (UnimplementedIRCPluginServer) SendChannelMessage ¶
func (UnimplementedIRCPluginServer) SendChannelMessage(context.Context, *ChannelMessage) (*Error, error)
func (UnimplementedIRCPluginServer) SendRawMessage ¶
func (UnimplementedIRCPluginServer) SendRawMessage(context.Context, *RawMessage) (*Error, error)
func (UnimplementedIRCPluginServer) SendRelayMessage ¶ added in v5.0.3
func (UnimplementedIRCPluginServer) SendRelayMessage(context.Context, *RelayMessage) (*Error, error)
type UnsafeHTTPPluginServer ¶
type UnsafeHTTPPluginServer interface {
// contains filtered or unexported methods
}
UnsafeHTTPPluginServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HTTPPluginServer will result in compilation errors.
type UnsafeIRCPluginServer ¶
type UnsafeIRCPluginServer interface {
// contains filtered or unexported methods
}
UnsafeIRCPluginServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IRCPluginServer will result in compilation errors.