Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNilTransport should be returned in places where a transport is required but is not set. ErrNilTransport = errors.New("transport cannot be nil") // ErrUserNotFound is returned if teh transport cannot locate a given user. ErrUserNotFound = errors.New("user not found") )
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct { *pb.BaseChannel Transport }
Channel wraps a pb.BaseChannel up with it's accomanied transport.
type Event ¶
type Event struct { *pb.BaseEvent Transport }
Event wraps a pb.BaseEvent up with it's accompanied transport.
type Transport ¶
type Transport interface { // TunnelEvents translates a specified network's events to Events tunneling them into evCh. // The session is terminated when ctx.Done returns. TunnelEvents(ctx context.Context, evCh chan *Event, errCh chan error) // SendMessage sends a message using the default format specified in the given transport. SendMessage(dest, msg string) error // SendEvent sends a new event over the given transport. SendEvent(ev *Event) error // Channels lists all the channels we have access to via this transport. Channels() ([]*Channel, error) // GetUser returns the full user data for the provided name or ID. GetUser(user string) (*User, error) // GetUsers returns a list of all known users. GetUsers() ([]*User, error) // GetConversation gets a private conversation for the given user ID. // This varies depending on network (may just be the user ID) but is required for Slack. GetConversation(userID string) (string, error) }
Transport provides standard io access to a network transport layer.
Click to show internal directories.
Click to hide internal directories.