server

package
v0.0.0-...-2fcdea6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2016 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BadRequestError represents a JSON response for status 400
	BadRequestError = ErrorResponse{"error": "Bad Request"}
	// UnauthorizedError represents a JSON response for status 401
	UnauthorizedError = ErrorResponse{"error": "Unauthorized"}
	// NotFoundError represents a JSON response for status 404
	NotFoundError = ErrorResponse{"error": "Not Found"}
	// InternalError represents a JSON response for status 500
	InternalError = ErrorResponse{"error": "Internal Server Error"}
)

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse map[string]string

ErrorResponse represents a JSON response to be returned in failure cases

func CustomError

func CustomError(message string) ErrorResponse

CustomError creates an ErrorResponse with a custom message

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server provides an HTTP interface to manipulate Playbooks and Instances

func New

func New(s store.Store) *Server

New instantiates a new Server and binds its handlers. The Server will look for playbooks and instances in store `s`

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns a reference to the Gin engine that powers Server

func (*Server) Init

func (s *Server) Init()

Init initializes manifests and playbooks for the server.

func (*Server) Run

func (s *Server) Run(addr ...string) error

Run starts the server on the specified address

type SlackCommand

type SlackCommand struct {
	Token       string `form:"token"`
	TeamID      string `form:"team_id"`
	TeamDomain  string `form:"team_domain"`
	ChannelID   string `form:"channel_id"`
	ChannelName string `form:"channel_name"`
	UserID      string `form:"user_id"`
	UserName    string `form:"user_name"`
	Command     string `form:"command"`
	Text        string `form:"text"`
	ResponseURL string `form:"response_url"`
}

SlackCommand represents the unmarshalled JSON post data from Slack

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL