rpc

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CtxWithToken

func CtxWithToken(ctx context.Context, scheme string, token string) context.Context

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) Descriptor() ([]byte, []int)

func (*Channel) GetName

func (m *Channel) GetName() string

func (*Channel) ProtoMessage

func (*Channel) ProtoMessage()

func (*Channel) Reset

func (m *Channel) Reset()

func (*Channel) String

func (m *Channel) String() string

func (*Channel) XXX_DiscardUnknown

func (m *Channel) XXX_DiscardUnknown()

func (*Channel) XXX_Marshal

func (m *Channel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Channel) XXX_Merge

func (m *Channel) XXX_Merge(src proto.Message)

func (*Channel) XXX_Size

func (m *Channel) XXX_Size() int

func (*Channel) XXX_Unmarshal

func (m *Channel) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Error) GetMessage

func (m *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) String

func (m *Error) String() string

func (*Error) XXX_DiscardUnknown

func (m *Error) XXX_DiscardUnknown()

func (*Error) XXX_Marshal

func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Error) XXX_Merge

func (m *Error) XXX_Merge(src proto.Message)

func (*Error) XXX_Size

func (m *Error) XXX_Size() int

func (*Error) XXX_Unmarshal

func (m *Error) XXX_Unmarshal(b []byte) error

type GrpcServer

type GrpcServer struct {
	// contains filtered or unexported fields
}

func NewGrpcServer added in v1.3.1

func NewGrpcServer(conn *irc.Connection, eventManager *irc.EventManager, rpcPort int, plugins []Plugin) GrpcServer

func (*GrpcServer) StartGRPC

func (s *GrpcServer) StartGRPC()

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 added in v1.1.0

type Plugin struct {
	Name  string
	Token string
}

func ParsePluginString added in v1.1.0

func ParsePluginString(pluginString string) (plugins []Plugin, err error)

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 UnimplementedIRCPluginServer

type UnimplementedIRCPluginServer struct {
}

UnimplementedIRCPluginServer can be embedded to have forward compatible implementations.

func (*UnimplementedIRCPluginServer) GetMessages

func (*UnimplementedIRCPluginServer) Ping

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)

Jump to

Keyboard shortcuts

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