Documentation ¶
Index ¶
- Constants
- func CtxLogger(ctx context.Context) *logrus.Entry
- func CtxStreamID(ctx context.Context) uuid.UUID
- func CtxTag(ctx context.Context) string
- func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context
- func WithStreamID(ctx context.Context, id uuid.UUID) context.Context
- func WithTag(ctx context.Context, tag string) context.Context
- type CommandMetadata
- type ContextKey
- type EventStream
- func (s *EventStream) Close()
- func (s *EventStream) CommandInfo(command string) *CommandMetadata
- func (s *EventStream) Commands() []string
- func (s *EventStream) ConnectionTime() time.Time
- func (s *EventStream) ID() uuid.UUID
- func (s *EventStream) Recv(ctx context.Context) (*pb.Event, error)
- func (s *EventStream) RemoteAddr() net.Addr
- func (s *EventStream) Send(e *pb.Event) error
- func (s *EventStream) Tag() string
- type Server
- func (s *Server) GetChannelInfo(ctx context.Context, req *pb.ChannelInfoRequest) (*pb.ChannelInfoResponse, error)
- func (s *Server) GetCoreInfo(ctx context.Context, req *pb.CoreInfoRequest) (*pb.CoreInfoResponse, error)
- func (s *Server) GetStreamInfo(ctx context.Context, req *pb.StreamInfoRequest) (*pb.StreamInfoResponse, error)
- func (s *Server) JoinChannel(ctx context.Context, req *pb.JoinChannelRequest) (*pb.JoinChannelResponse, error)
- func (s *Server) LeaveChannel(ctx context.Context, req *pb.LeaveChannelRequest) (*pb.LeaveChannelResponse, error)
- func (s *Server) ListChannels(ctx context.Context, req *pb.ListChannelsRequest) (*pb.ListChannelsResponse, error)
- func (s *Server) ListStreams(ctx context.Context, req *pb.ListStreamsRequest) (*pb.ListStreamsResponse, error)
- func (s *Server) NewStream(ctx context.Context, addr net.Addr, meta map[string]*CommandMetadata) (context.Context, *EventStream)
- func (s *Server) Run() error
- func (s *Server) SendMessage(ctx context.Context, req *pb.SendMessageRequest) (*pb.SendMessageResponse, error)
- func (s *Server) SetChannelTopic(ctx context.Context, req *pb.SetChannelTopicRequest) (*pb.SetChannelTopicResponse, error)
- func (s *Server) SetTokens(tokens map[string]string)
- func (s *Server) StreamEvents(req *pb.StreamEventsRequest, outputStream pb.Seabird_StreamEventsServer) error
- type ServerConfig
Constants ¶
View Source
const EVENT_STREAM_BUFFER = 10
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandMetadata ¶
type ContextKey ¶
type ContextKey string
func (ContextKey) String ¶
func (key ContextKey) String() string
type EventStream ¶
func NewEventStream ¶
func NewEventStream(ctx context.Context, addr net.Addr, meta map[string]*CommandMetadata) *EventStream
func (*EventStream) Close ¶
func (s *EventStream) Close()
func (*EventStream) CommandInfo ¶
func (s *EventStream) CommandInfo(command string) *CommandMetadata
func (*EventStream) Commands ¶
func (s *EventStream) Commands() []string
func (*EventStream) ConnectionTime ¶
func (s *EventStream) ConnectionTime() time.Time
func (*EventStream) ID ¶
func (s *EventStream) ID() uuid.UUID
func (*EventStream) RemoteAddr ¶
func (s *EventStream) RemoteAddr() net.Addr
func (*EventStream) Tag ¶
func (s *EventStream) Tag() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(config ServerConfig) (*Server, error)
func (*Server) GetChannelInfo ¶
func (s *Server) GetChannelInfo(ctx context.Context, req *pb.ChannelInfoRequest) (*pb.ChannelInfoResponse, error)
func (*Server) GetCoreInfo ¶
func (s *Server) GetCoreInfo(ctx context.Context, req *pb.CoreInfoRequest) (*pb.CoreInfoResponse, error)
GetCoreInfo implements SeabirdServer.GetCoreInfo
func (*Server) GetStreamInfo ¶
func (s *Server) GetStreamInfo(ctx context.Context, req *pb.StreamInfoRequest) (*pb.StreamInfoResponse, error)
GetStreamInfo implements SeabirdServer.GetStreamInfo
func (*Server) JoinChannel ¶
func (s *Server) JoinChannel(ctx context.Context, req *pb.JoinChannelRequest) (*pb.JoinChannelResponse, error)
func (*Server) LeaveChannel ¶
func (s *Server) LeaveChannel(ctx context.Context, req *pb.LeaveChannelRequest) (*pb.LeaveChannelResponse, error)
func (*Server) ListChannels ¶
func (s *Server) ListChannels(ctx context.Context, req *pb.ListChannelsRequest) (*pb.ListChannelsResponse, error)
func (*Server) ListStreams ¶
func (s *Server) ListStreams(ctx context.Context, req *pb.ListStreamsRequest) (*pb.ListStreamsResponse, error)
ListStreams implements SeabirdServer.ListStreams
func (*Server) NewStream ¶
func (s *Server) NewStream(ctx context.Context, addr net.Addr, meta map[string]*CommandMetadata) (context.Context, *EventStream)
func (*Server) SendMessage ¶
func (s *Server) SendMessage(ctx context.Context, req *pb.SendMessageRequest) (*pb.SendMessageResponse, error)
func (*Server) SetChannelTopic ¶
func (s *Server) SetChannelTopic(ctx context.Context, req *pb.SetChannelTopicRequest) (*pb.SetChannelTopicResponse, error)
SetChannelInfo implements SeabirdServer.SetChannelTopic
func (*Server) SetTokens ¶
SetTokens allows an external method to update the tokens of the currently running server to avoid having to restart when they are added.
func (*Server) StreamEvents ¶
func (s *Server) StreamEvents(req *pb.StreamEventsRequest, outputStream pb.Seabird_StreamEventsServer) error
type ServerConfig ¶
type ServerConfig struct { IrcHost string `json:"irc_host"` Nick string `json:"irc_nick"` User string `json:"irc_user"` Name string `json:"irc_name"` Pass string `json:"irc_pass"` CommandPrefix string `json:"command_prefix"` BindHost string `json:"bind_host"` EnableWeb bool `json:"enable_web"` Tokens map[string]string `json:"tokens"` }
Click to show internal directories.
Click to hide internal directories.