Documentation ¶
Index ¶
- Variables
- func NewRouter(enableCors bool, store Store) *mux.Router
- func ProcessJobExecuteMessage(request *MessageRequest) error
- func ProcessJobSelectMessage(request *MessageRequest) error
- func ProcessSystemEventMessage(request *MessageRequest) error
- func RegisterStore(name string, value interface{})
- func ResolveJobBaseRequest(c *Context) string
- func ResolveJobsAllocDataRequest(c *Context) string
- func ResolveServersRequest(c *Context) string
- type Context
- func (c *Context) Form(name string) string
- func (c *Context) Get(key string) interface{}
- func (c *Context) JSON(code int, v interface{}) error
- func (c *Context) JSONP(code int, callback string, v interface{}) error
- func (c *Context) Query(name string) string
- func (c *Context) Request() *http.Request
- func (c *Context) Response() *Response
- func (c *Context) Set(key string, v interface{})
- func (c *Context) WriteHeader(code int)
- type Dispatcher
- type GetJobBaseResponse
- type GetJobsAllocDataResponse
- type GetServersResponse
- type HandleResponse
- type JobActionRequest
- type JobLogRequest
- type MessageRequest
- type Response
- func (r *Response) Flush()
- func (r *Response) Header() http.Header
- func (r *Response) SetWriter(w http.ResponseWriter)
- func (r *Response) Size() int64
- func (r *Response) Status() int
- func (r *Response) Write(b []byte) (int, error)
- func (r *Response) WriteHeader(code int)
- func (r *Response) Writer() http.ResponseWriter
- type ResponseImpl
- type Server
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRequestSuccessed = errors.New("request successed.") ErrRequestAccepted = errors.New("request accepted.") ErrRequestResolveInvaild = errors.New("request resolve invaild.") ErrRequestNotFound = errors.New("request resource not found.") ErrRequestServerException = errors.New("request server exception.") ErrRequestAllocNotFound = errors.New("request resource not found in cache alloc.") )
Functions ¶
func ProcessJobExecuteMessage ¶
func ProcessJobExecuteMessage(request *MessageRequest) error
ProcessJobExecuteMessage is exported
func ProcessJobSelectMessage ¶
func ProcessJobSelectMessage(request *MessageRequest) error
ProcessJobSelectMessage is exported
func ProcessSystemEventMessage ¶
func ProcessSystemEventMessage(request *MessageRequest) error
ProcessSystemEventMessage is exported
func RegisterStore ¶
func RegisterStore(name string, value interface{})
func ResolveJobBaseRequest ¶
ResolveJobBaseRequest is exported
func ResolveJobsAllocDataRequest ¶
ResolveJobsAllocDataRequest is exported
func ResolveServersRequest ¶
ResolveServersRequest is exported
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func (*Dispatcher) ServeHTTP ¶
func (dispatcher *Dispatcher) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*Dispatcher) SetHandler ¶
func (dispatcher *Dispatcher) SetHandler(handler http.Handler)
type GetJobBaseResponse ¶
GetJobBaseResponse is exported
type GetJobsAllocDataResponse ¶
type GetJobsAllocDataResponse struct {
JobsAlloc *models.JobsAllocData `json:"alloc"`
}
GetJobsAllocDataResponse is exported
type GetServersResponse ¶
GetServersResponse is exported
type HandleResponse ¶
type HandleResponse interface { SetContent(content string) SetData(data interface{}) }
HandleResponse is exportyed
type JobActionRequest ¶
type JobActionRequest struct { Context *Context Runtime string `json:"runtime"` JobId string `json:"jobid"` Action string `json:"action"` }
JobActionRequest is exported
func ResolveJobActionRequest ¶
func ResolveJobActionRequest(c *Context) *JobActionRequest
ResolveJobActionRequest is exported
type JobLogRequest ¶
JobLogRequest is exported
func ResloveJogRequest ¶
func ResloveJogRequest(c *Context) *JobLogRequest
ResloveJogRequest is exported
type MessageRequest ¶
MessageRequest is exported
func ResolveMessageRequest ¶
func ResolveMessageRequest(c *Context) *MessageRequest
ResolveMessageRequest is exported
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse(w http.ResponseWriter) *Response
func (*Response) SetWriter ¶
func (r *Response) SetWriter(w http.ResponseWriter)
func (*Response) WriteHeader ¶
func (*Response) Writer ¶
func (r *Response) Writer() http.ResponseWriter
type ResponseImpl ¶
type ResponseImpl struct { HandleResponse `json:"-,omitempty"` Content string `json:"content"` Data interface{} `json:"data,omitempty"` }
ResponseImpl is exported
func (*ResponseImpl) SetContent ¶
func (response *ResponseImpl) SetContent(content string)
SetContent is exported
func (*ResponseImpl) SetData ¶
func (response *ResponseImpl) SetData(data interface{})
SetData is exported
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenHosts ¶
func (*Server) SetHandler ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.