Documentation
¶
Index ¶
- func CORS(next http.HandlerFunc) http.HandlerFunc
- func GetBanner(version string) string
- func GetHelpString() string
- func GetUsageString() string
- func Health(version string) http.HandlerFunc
- func ServeWeb() http.Handler
- type Attachment
- type ErrorResponse
- type HealthResponse
- type Module
- type MooRequest
- type MooResponse
- type SlackResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORS ¶
func CORS(next http.HandlerFunc) http.HandlerFunc
CORS adds CORS headers to allow cross-origin requests
func GetHelpString ¶
func GetHelpString() string
GetHelpString returns the help string with available cows and moods
Types ¶
type Attachment ¶
type Attachment struct {
Text string `json:"text,omitempty"`
}
Attachment represents a Slack attachment
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse represents an error response
type HealthResponse ¶
HealthResponse represents health check response
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module holds handler dependencies
func NewModule ¶
func NewModule() *Module
NewModule creates a new API handler module with configuration from environment
func (*Module) APICows ¶
func (m *Module) APICows(w http.ResponseWriter, r *http.Request)
APICows handles /api/cows endpoint - lists all available cows
func (*Module) APIMoo ¶
func (m *Module) APIMoo(w http.ResponseWriter, r *http.Request)
APIMoo handles /api/moo endpoint - accepts both JSON and query params
type MooRequest ¶
type MooRequest struct {
Text string `json:"text"`
Cow string `json:"cow,omitempty"`
Mood string `json:"mood,omitempty"`
Action string `json:"action,omitempty"`
Columns int `json:"columns,omitempty"`
}
MooRequest represents a request to generate cowsay
type MooResponse ¶
type MooResponse struct {
Output string `json:"output"`
}
MooResponse represents the cowsay output
type SlackResponse ¶
type SlackResponse struct {
ResponseType string `json:"response_type,omitempty"`
Text string `json:"text,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
}
SlackResponse represents a Slack-compatible response
Click to show internal directories.
Click to hide internal directories.