Versions in this module Expand all Collapse all v0 v0.0.10 Jan 6, 2016 Changes in this version + var ErrInvalidToken = errors.New("slash: invalid token") + var ErrNoHandler = errors.New("slash: no handler") + var NoResponse = Response + func Params(ctx context.Context) map[string]string + func WithParams(ctx context.Context, params map[string]string) context.Context + type Command struct + ChannelID string + ChannelName string + Command string + ResponseURL *url.URL + TeamDomain string + TeamID string + Text string + Token string + UserID string + UserName string + func CommandFromValues(v url.Values) (Command, error) + func ParseRequest(r *http.Request) (Command, error) + type Handler interface + ServeCommand func(context.Context, Responder, Command) (Response, error) + func ValidateToken(h Handler, token string) Handler + type HandlerFunc func(context.Context, Responder, Command) (Response, error) + func (fn HandlerFunc) ServeCommand(ctx context.Context, r Responder, command Command) (Response, error) + type Matcher interface + Match func(Command) (map[string]string, bool) + func MatchCommand(cmd string) Matcher + func MatchSubcommand(subcmd string) Matcher + func MatchTextRegexp(r *regexp.Regexp) Matcher + type MatcherFunc func(Command) (map[string]string, bool) + func (fn MatcherFunc) Match(command Command) (map[string]string, bool) + type Mux struct + func NewMux() *Mux + func (m *Mux) Command(command, token string, handler Handler) *Route + func (m *Mux) Handler(command Command) (Handler, map[string]string) + func (m *Mux) Match(matcher Matcher, handler Handler) *Route + func (m *Mux) MatchText(re *regexp.Regexp, handler Handler) *Route + func (m *Mux) ServeCommand(ctx context.Context, r Responder, command Command) (Response, error) + type Responder interface + Respond func(Response) error + type Response struct + InChannel bool + Text string + func Reply(text string) Response + func Say(text string) Response + type Route struct + func NewRoute(handler Handler) *Route + type Server struct + func NewServer(h Handler) *Server + func (h *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)