Documentation ¶
Index ¶
- func ConvertFromRPCHeaders(headers []*HttpHeader) http.Header
- 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 *zap.SugaredLogger) *httpServer
- func RegisterHTTPPluginServer(s *grpc.Server, srv HTTPPluginServer)
- func RegisterIRCPluginServer(s *grpc.Server, srv IRCPluginServer)
- type Channel
- func (*Channel) Descriptor() ([]byte, []int)
- func (m *Channel) GetName() string
- func (*Channel) ProtoMessage()
- func (m *Channel) Reset()
- func (m *Channel) String() string
- func (m *Channel) XXX_DiscardUnknown()
- func (m *Channel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Channel) XXX_Merge(src proto.Message)
- func (m *Channel) XXX_Size() int
- func (m *Channel) XXX_Unmarshal(b []byte) error
- type ChannelMessage
- func (*ChannelMessage) Descriptor() ([]byte, []int)
- func (m *ChannelMessage) GetChannel() string
- func (m *ChannelMessage) GetMessage() string
- func (m *ChannelMessage) GetSource() string
- func (*ChannelMessage) ProtoMessage()
- func (m *ChannelMessage) Reset()
- func (m *ChannelMessage) String() string
- func (m *ChannelMessage) XXX_DiscardUnknown()
- func (m *ChannelMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ChannelMessage) XXX_Merge(src proto.Message)
- func (m *ChannelMessage) XXX_Size() int
- func (m *ChannelMessage) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type Error
- func (*Error) Descriptor() ([]byte, []int)
- func (m *Error) GetMessage() string
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) String() string
- func (m *Error) XXX_DiscardUnknown()
- func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Error) XXX_Merge(src proto.Message)
- func (m *Error) XXX_Size() int
- func (m *Error) XXX_Unmarshal(b []byte) error
- type GrpcServer
- type HTTPPluginClient
- type HTTPPluginServer
- type HTTPPlugin_GetRequestClient
- type HTTPPlugin_GetRequestServer
- type HttpHeader
- func (*HttpHeader) Descriptor() ([]byte, []int)
- func (m *HttpHeader) GetKey() string
- func (m *HttpHeader) GetValue() string
- func (*HttpHeader) ProtoMessage()
- func (m *HttpHeader) Reset()
- func (m *HttpHeader) String() string
- func (m *HttpHeader) XXX_DiscardUnknown()
- func (m *HttpHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HttpHeader) XXX_Merge(src proto.Message)
- func (m *HttpHeader) XXX_Size() int
- func (m *HttpHeader) XXX_Unmarshal(b []byte) error
- type HttpRequest
- func (*HttpRequest) Descriptor() ([]byte, []int)
- func (m *HttpRequest) GetBody() []byte
- func (m *HttpRequest) GetHeader() []*HttpHeader
- func (m *HttpRequest) GetMethod() string
- func (m *HttpRequest) GetPath() string
- func (*HttpRequest) ProtoMessage()
- func (m *HttpRequest) Reset()
- func (m *HttpRequest) String() string
- func (m *HttpRequest) XXX_DiscardUnknown()
- func (m *HttpRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HttpRequest) XXX_Merge(src proto.Message)
- func (m *HttpRequest) XXX_Size() int
- func (m *HttpRequest) XXX_Unmarshal(b []byte) error
- type HttpResponse
- func (*HttpResponse) Descriptor() ([]byte, []int)
- func (m *HttpResponse) GetBody() []byte
- func (m *HttpResponse) GetHeader() []*HttpHeader
- func (m *HttpResponse) GetStatus() int32
- func (*HttpResponse) ProtoMessage()
- func (m *HttpResponse) Reset()
- func (m *HttpResponse) String() string
- func (m *HttpResponse) XXX_DiscardUnknown()
- func (m *HttpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HttpResponse) XXX_Merge(src proto.Message)
- func (m *HttpResponse) XXX_Size() int
- func (m *HttpResponse) XXX_Unmarshal(b []byte) error
- type IRCPluginClient
- type IRCPluginServer
- type IRCPlugin_GetMessagesClient
- type IRCPlugin_GetMessagesServer
- type Plugin
- type RawMessage
- func (*RawMessage) Descriptor() ([]byte, []int)
- func (m *RawMessage) GetMessage() string
- func (*RawMessage) ProtoMessage()
- func (m *RawMessage) Reset()
- func (m *RawMessage) String() string
- func (m *RawMessage) XXX_DiscardUnknown()
- func (m *RawMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RawMessage) XXX_Merge(src proto.Message)
- func (m *RawMessage) XXX_Size() int
- func (m *RawMessage) XXX_Unmarshal(b []byte) error
- type Route
- func (*Route) Descriptor() ([]byte, []int)
- func (m *Route) GetPrefix() string
- func (*Route) ProtoMessage()
- func (m *Route) Reset()
- func (m *Route) String() string
- func (m *Route) XXX_DiscardUnknown()
- func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Route) XXX_Merge(src proto.Message)
- func (m *Route) XXX_Size() int
- func (m *Route) XXX_Unmarshal(b []byte) error
- type UnimplementedHTTPPluginServer
- type UnimplementedIRCPluginServer
- func (*UnimplementedIRCPluginServer) GetMessages(req *Channel, srv IRCPlugin_GetMessagesServer) error
- func (*UnimplementedIRCPluginServer) Ping(ctx context.Context, req *Empty) (*Empty, error)
- func (*UnimplementedIRCPluginServer) SendChannelMessage(ctx context.Context, req *ChannelMessage) (*Error, error)
- func (*UnimplementedIRCPluginServer) SendRawMessage(ctx context.Context, req *RawMessage) (*Error, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertFromRPCHeaders ¶
func ConvertFromRPCHeaders(headers []*HttpHeader) http.Header
func CtxWithToken ¶
func CtxWithTokenAndPath ¶
func NewHttpServer ¶
func NewHttpServer(port int, plugin []Plugin, logger *zap.SugaredLogger) *httpServer
func RegisterHTTPPluginServer ¶
func RegisterHTTPPluginServer(s *grpc.Server, srv HTTPPluginServer)
func RegisterIRCPluginServer ¶
func RegisterIRCPluginServer(s *grpc.Server, srv IRCPluginServer)
Types ¶
type Channel ¶
type Channel struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Channel) Descriptor ¶
func (*Channel) ProtoMessage ¶
func (*Channel) ProtoMessage()
func (*Channel) XXX_DiscardUnknown ¶
func (m *Channel) XXX_DiscardUnknown()
func (*Channel) XXX_Marshal ¶
func (*Channel) XXX_Unmarshal ¶
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ChannelMessage) Descriptor ¶
func (*ChannelMessage) Descriptor() ([]byte, []int)
func (*ChannelMessage) GetChannel ¶
func (m *ChannelMessage) GetChannel() string
func (*ChannelMessage) GetMessage ¶
func (m *ChannelMessage) GetMessage() string
func (*ChannelMessage) GetSource ¶
func (m *ChannelMessage) GetSource() string
func (*ChannelMessage) ProtoMessage ¶
func (*ChannelMessage) ProtoMessage()
func (*ChannelMessage) Reset ¶
func (m *ChannelMessage) Reset()
func (*ChannelMessage) String ¶
func (m *ChannelMessage) String() string
func (*ChannelMessage) XXX_DiscardUnknown ¶
func (m *ChannelMessage) XXX_DiscardUnknown()
func (*ChannelMessage) XXX_Marshal ¶
func (m *ChannelMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ChannelMessage) XXX_Merge ¶
func (m *ChannelMessage) XXX_Merge(src proto.Message)
func (*ChannelMessage) XXX_Size ¶
func (m *ChannelMessage) XXX_Size() int
func (*ChannelMessage) XXX_Unmarshal ¶
func (m *ChannelMessage) XXX_Unmarshal(b []byte) error
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type Error ¶
type Error struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Error) Descriptor ¶
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) XXX_DiscardUnknown ¶
func (m *Error) XXX_DiscardUnknown()
func (*Error) XXX_Marshal ¶
func (*Error) XXX_Unmarshal ¶
type GrpcServer ¶
type GrpcServer struct {
// contains filtered or unexported fields
}
func NewGrpcServer ¶
func NewGrpcServer(conn *irc.Connection, eventManager *irc.EventManager, rpcPort int, plugins []Plugin, webPort int, logger *zap.SugaredLogger) GrpcServer
func (*GrpcServer) StartGRPC ¶
func (s *GrpcServer) StartGRPC()
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://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewHTTPPluginClient ¶
func NewHTTPPluginClient(cc grpc.ClientConnInterface) HTTPPluginClient
type HTTPPluginServer ¶
type HTTPPluginServer interface {
GetRequest(HTTPPlugin_GetRequestServer) error
}
HTTPPluginServer is the server API for HTTPPlugin service.
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func ConvertToRPCHeaders ¶
func ConvertToRPCHeaders(headers http.Header) []*HttpHeader
func (*HttpHeader) Descriptor ¶
func (*HttpHeader) Descriptor() ([]byte, []int)
func (*HttpHeader) GetKey ¶
func (m *HttpHeader) GetKey() string
func (*HttpHeader) GetValue ¶
func (m *HttpHeader) GetValue() string
func (*HttpHeader) ProtoMessage ¶
func (*HttpHeader) ProtoMessage()
func (*HttpHeader) Reset ¶
func (m *HttpHeader) Reset()
func (*HttpHeader) String ¶
func (m *HttpHeader) String() string
func (*HttpHeader) XXX_DiscardUnknown ¶
func (m *HttpHeader) XXX_DiscardUnknown()
func (*HttpHeader) XXX_Marshal ¶
func (m *HttpHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HttpHeader) XXX_Merge ¶
func (m *HttpHeader) XXX_Merge(src proto.Message)
func (*HttpHeader) XXX_Size ¶
func (m *HttpHeader) XXX_Size() int
func (*HttpHeader) XXX_Unmarshal ¶
func (m *HttpHeader) XXX_Unmarshal(b []byte) error
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HttpRequest) Descriptor ¶
func (*HttpRequest) Descriptor() ([]byte, []int)
func (*HttpRequest) GetBody ¶
func (m *HttpRequest) GetBody() []byte
func (*HttpRequest) GetHeader ¶
func (m *HttpRequest) GetHeader() []*HttpHeader
func (*HttpRequest) GetMethod ¶
func (m *HttpRequest) GetMethod() string
func (*HttpRequest) GetPath ¶
func (m *HttpRequest) GetPath() string
func (*HttpRequest) ProtoMessage ¶
func (*HttpRequest) ProtoMessage()
func (*HttpRequest) Reset ¶
func (m *HttpRequest) Reset()
func (*HttpRequest) String ¶
func (m *HttpRequest) String() string
func (*HttpRequest) XXX_DiscardUnknown ¶
func (m *HttpRequest) XXX_DiscardUnknown()
func (*HttpRequest) XXX_Marshal ¶
func (m *HttpRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HttpRequest) XXX_Merge ¶
func (m *HttpRequest) XXX_Merge(src proto.Message)
func (*HttpRequest) XXX_Size ¶
func (m *HttpRequest) XXX_Size() int
func (*HttpRequest) XXX_Unmarshal ¶
func (m *HttpRequest) XXX_Unmarshal(b []byte) error
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HttpResponse) Descriptor ¶
func (*HttpResponse) Descriptor() ([]byte, []int)
func (*HttpResponse) GetBody ¶
func (m *HttpResponse) GetBody() []byte
func (*HttpResponse) GetHeader ¶
func (m *HttpResponse) GetHeader() []*HttpHeader
func (*HttpResponse) GetStatus ¶
func (m *HttpResponse) GetStatus() int32
func (*HttpResponse) ProtoMessage ¶
func (*HttpResponse) ProtoMessage()
func (*HttpResponse) Reset ¶
func (m *HttpResponse) Reset()
func (*HttpResponse) String ¶
func (m *HttpResponse) String() string
func (*HttpResponse) XXX_DiscardUnknown ¶
func (m *HttpResponse) XXX_DiscardUnknown()
func (*HttpResponse) XXX_Marshal ¶
func (m *HttpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HttpResponse) XXX_Merge ¶
func (m *HttpResponse) XXX_Merge(src proto.Message)
func (*HttpResponse) XXX_Size ¶
func (m *HttpResponse) XXX_Size() int
func (*HttpResponse) XXX_Unmarshal ¶
func (m *HttpResponse) XXX_Unmarshal(b []byte) error
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) SendRawMessage(ctx context.Context, in *RawMessage, opts ...grpc.CallOption) (*Error, error) GetMessages(ctx context.Context, in *Channel, opts ...grpc.CallOption) (IRCPlugin_GetMessagesClient, error) }
IRCPluginClient is the client API for IRCPlugin service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#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) SendRawMessage(context.Context, *RawMessage) (*Error, error) GetMessages(*Channel, IRCPlugin_GetMessagesServer) error }
IRCPluginServer is the server API for IRCPlugin service.
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RawMessage) Descriptor ¶
func (*RawMessage) Descriptor() ([]byte, []int)
func (*RawMessage) GetMessage ¶
func (m *RawMessage) GetMessage() string
func (*RawMessage) ProtoMessage ¶
func (*RawMessage) ProtoMessage()
func (*RawMessage) Reset ¶
func (m *RawMessage) Reset()
func (*RawMessage) String ¶
func (m *RawMessage) String() string
func (*RawMessage) XXX_DiscardUnknown ¶
func (m *RawMessage) XXX_DiscardUnknown()
func (*RawMessage) XXX_Marshal ¶
func (m *RawMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RawMessage) XXX_Merge ¶
func (m *RawMessage) XXX_Merge(src proto.Message)
func (*RawMessage) XXX_Size ¶
func (m *RawMessage) XXX_Size() int
func (*RawMessage) XXX_Unmarshal ¶
func (m *RawMessage) XXX_Unmarshal(b []byte) error
type Route ¶
type Route struct { Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Route) Descriptor ¶
func (*Route) ProtoMessage ¶
func (*Route) ProtoMessage()
func (*Route) XXX_DiscardUnknown ¶
func (m *Route) XXX_DiscardUnknown()
func (*Route) XXX_Marshal ¶
func (*Route) XXX_Unmarshal ¶
type UnimplementedHTTPPluginServer ¶
type UnimplementedHTTPPluginServer struct { }
UnimplementedHTTPPluginServer can be embedded to have forward compatible implementations.
func (*UnimplementedHTTPPluginServer) GetRequest ¶
func (*UnimplementedHTTPPluginServer) GetRequest(srv HTTPPlugin_GetRequestServer) error
type UnimplementedIRCPluginServer ¶
type UnimplementedIRCPluginServer struct { }
UnimplementedIRCPluginServer can be embedded to have forward compatible implementations.
func (*UnimplementedIRCPluginServer) GetMessages ¶
func (*UnimplementedIRCPluginServer) GetMessages(req *Channel, srv IRCPlugin_GetMessagesServer) error
func (*UnimplementedIRCPluginServer) SendChannelMessage ¶
func (*UnimplementedIRCPluginServer) SendChannelMessage(ctx context.Context, req *ChannelMessage) (*Error, error)
func (*UnimplementedIRCPluginServer) SendRawMessage ¶
func (*UnimplementedIRCPluginServer) SendRawMessage(ctx context.Context, req *RawMessage) (*Error, error)