Documentation ¶
Index ¶
- Constants
- func Error(w http.ResponseWriter, code int, err error, msg string)
- func JSON(w http.ResponseWriter, code int, src interface{})
- func Respond(w http.ResponseWriter, code int, src interface{})
- type CLI
- type ErrorResponse
- type Server
- func (s *Server) Enqueue(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetTeam(w http.ResponseWriter, r *http.Request)
- func (s *Server) History(w http.ResponseWriter, r *http.Request)
- func (s *Server) Login(w http.ResponseWriter, r *http.Request)
- func (s *Server) Logout(w http.ResponseWriter, r *http.Request)
- func (s *Server) Polling() error
- func (s *Server) Queues(w http.ResponseWriter, r *http.Request)
- func (s *Server) Routes() *router.Router
- func (s *Server) Run(port int) error
- func (s *Server) ScoreDetail(w http.ResponseWriter, r *http.Request, id int)
Constants ¶
View Source
const ( ExitCodeOK = 0 // Specific error codes. begin 10- ExitCodeError = 10 + iota ExitCodeParseError ExitCodeInvalidArgsError )
Exit codes. used only in Run()
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, code int, err error, msg string)
Error is wrapped Respond when error response
func JSON ¶
func JSON(w http.ResponseWriter, code int, src interface{})
JSON is wrapped Respond when success response
func Respond ¶
func Respond(w http.ResponseWriter, code int, src interface{})
Respond is response write to ResponseWriter
Types ¶
type ErrorResponse ¶
ErrorResponse is Error response template
func (*ErrorResponse) String ¶
func (e *ErrorResponse) String() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server supply HTTP server of the portal
func (*Server) Enqueue ¶
func (s *Server) Enqueue(w http.ResponseWriter, r *http.Request)
Enqueue send queue to the pubsub server
func (*Server) GetTeam ¶
func (s *Server) GetTeam(w http.ResponseWriter, r *http.Request)
GetTeam returns login team
func (*Server) History ¶
func (s *Server) History(w http.ResponseWriter, r *http.Request)
History returns score histories
func (*Server) Login ¶
func (s *Server) Login(w http.ResponseWriter, r *http.Request)
Login authentication user and save user for session
func (*Server) Logout ¶
func (s *Server) Logout(w http.ResponseWriter, r *http.Request)
Logout returns login page with cleanup session
func (*Server) Queues ¶
func (s *Server) Queues(w http.ResponseWriter, r *http.Request)
Queues returns active queue list
func (*Server) ScoreDetail ¶
ScoreDetail returns score detail
Click to show internal directories.
Click to hide internal directories.