Documentation ¶
Index ¶
- Constants
- func GetChannelsHandler(ctx *AppContext, w http.ResponseWriter, r *http.Request)
- func LogReq(r *http.Request) *log.Entry
- func StartRestAPI(gctsdbServer *gctsdb.GCTSDBServer)
- type AppContext
- type AppHandler
- type Authentication
- type CORS
- type Channel
- type Created
- type HttpError
- type Logger
- type UberAuthorizator
Constants ¶
View Source
const ( PUT = "PUT" GET = "GET" POST = "POST" DELETE = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
func GetChannelsHandler ¶
func GetChannelsHandler(ctx *AppContext, w http.ResponseWriter, r *http.Request)
func StartRestAPI ¶
func StartRestAPI(gctsdbServer *gctsdb.GCTSDBServer)
Types ¶
type AppContext ¶
type AppContext struct {
GCTSDBServer *gctsdb.GCTSDBServer
}
type AppHandler ¶
type AppHandler struct { Context *AppContext // contains filtered or unexported fields }
func NewAppHandler ¶
func NewAppHandler(appContext *AppContext, r *mux.Router) AppHandler
func (*AppHandler) Handle ¶
func (h *AppHandler) Handle(method string, uri string, handler func(*AppContext, http.ResponseWriter, *http.Request), scopes ...string)
type Authentication ¶
func GetAuthentication ¶
func GetAuthentication(ctx *AppContext, r *http.Request) *Authentication
func (*Authentication) HasScope ¶
func (y *Authentication) HasScope(scope string) bool
type CORS ¶
type CORS struct {
// contains filtered or unexported fields
}
func (*CORS) ServeHTTP ¶
func (cors *CORS) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type Channel ¶
type HttpError ¶
type HttpError struct { HTTPCode int `json:"-"` ErrorCode string `json:"errorCode"` Message string `json:"errorMessage"` }
func NewHttpError ¶
func (*HttpError) WriteResponse ¶
func (e *HttpError) WriteResponse(w http.ResponseWriter)
type Logger ¶
type Logger struct { }
func (*Logger) ServeHTTP ¶
func (lg *Logger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type UberAuthorizator ¶
type UberAuthorizator struct {
// contains filtered or unexported fields
}
func (*UberAuthorizator) Handler ¶
func (ua *UberAuthorizator) Handler(rw http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.