Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHandler ¶
type APIHandler func(ctx context.Context, request APIRequest) error
type APIRequest ¶
type Controller ¶
type Controller interface {
GetConfig() ControllerConfig
}
type ControllerConfig ¶
type ControllerConfig struct {
Handler []Route
}
type ControllerImpl ¶
type ControllerImpl struct{}
type EventHandler ¶
type EventHandler func(ctx context.Context, request SocketRequest) error
type EventOptions ¶
type EventOptions func(event *SocketEvent)
func WithEventType ¶
func WithEventType(eventType any) EventOptions
func WithIdentifier ¶
func WithIdentifier(identifier string) EventOptions
type Route ¶
type Route struct { Method string Path string Handler APIHandler Version int Middlewares *[]func(http.Handler) http.Handler }
func RegisterRoute ¶
func RegisterRoute(method string, handler APIHandler, opts ...RouteOption) Route
func (*Route) GetVersionedPath ¶
type RouteOption ¶
type RouteOption func(event *Route)
func WithMiddleware ¶
func WithMiddleware(handlers ...func(http.Handler) http.Handler) RouteOption
func WithPath ¶
func WithPath(path string) RouteOption
func WithVersion ¶
func WithVersion(version int) RouteOption
type SocketEvent ¶
type SocketEvent struct { Handler EventHandler Type any Identifier string }
func RegisterEvent ¶
func RegisterEvent(handler EventHandler, opts ...EventOptions) SocketEvent
type SocketHandler ¶
type SocketHandler interface {
GetConfig() SocketHandlerConfig
}
type SocketHandlerConfig ¶
type SocketHandlerConfig struct {
Handler []SocketEvent
}
type SocketHandlerImpl ¶
type SocketHandlerImpl struct{}
type SocketRequest ¶
type SocketRequest struct { GetSlashCommandData func() (*slackpkg.SlashCommand, error) GetInteractionData func() (*slackpkg.InteractionCallback, error) GetEventData func() (*slackevents.EventsAPIEvent, error) Client *socketmode.Client Event *socketmode.Event }
Click to show internal directories.
Click to hide internal directories.