Documentation ¶
Index ¶
- Variables
- func DisplayStream(response *Response)
- func GetClientRequest(request *http.Request) *jobs.Request
- func HandleError(response http.ResponseWriter, err interface{})
- func HandleSighup()
- func HandleSigint()
- func Immediate(response http.ResponseWriter, request *http.Request)
- func Int2Bytes(value int) []byte
- func NewClient() http.Client
- func NewHttpServer(host string, port string) *http.Server
- func NewRouter() *mux.Router
- func Output(response http.ResponseWriter, request *http.Request)
- func Remove(response http.ResponseWriter, request *http.Request)
- func Schedule(response http.ResponseWriter, request *http.Request)
- func Status(response http.ResponseWriter, request *http.Request)
- func StreamResponse(job *jobs.ActiveJob, response http.ResponseWriter)
- func Tail(response http.ResponseWriter, request *http.Request)
- func TokenArray(config *accounts.ClientConfig) []string
- func TryWebServerRestart()
- func ValidateRequest(response http.ResponseWriter, request *http.Request) (*accounts.Account, error)
- func WatchFileChange()
- func WriteResponse(response http.ResponseWriter, args ...interface{})
- type Response
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var JSON = "application/json"
View Source
var StopStreaming = false
Functions ¶
func DisplayStream ¶
func DisplayStream(response *Response)
Just keep printing up the lines from the response, until the user closes it
func GetClientRequest ¶
Get the Request structure from HTTP request
func HandleError ¶
func HandleError(response http.ResponseWriter, err interface{})
Handle logging and sending back and error
func HandleSighup ¶
func HandleSighup()
func HandleSigint ¶
func HandleSigint()
func Immediate ¶
func Immediate(response http.ResponseWriter, request *http.Request)
Execute a command right away
func NewHttpServer ¶
Set up a server to handle http traffic
func Output ¶
func Output(response http.ResponseWriter, request *http.Request)
Execute a command right away
func Remove ¶
func Remove(response http.ResponseWriter, request *http.Request)
Execute a command right away
func Schedule ¶
func Schedule(response http.ResponseWriter, request *http.Request)
Execute a command right away
func Status ¶
func Status(response http.ResponseWriter, request *http.Request)
Execute a command right away
func StreamResponse ¶
func StreamResponse(job *jobs.ActiveJob, response http.ResponseWriter)
func Tail ¶
func Tail(response http.ResponseWriter, request *http.Request)
Execute a command right away
func TokenArray ¶
func TokenArray(config *accounts.ClientConfig) []string
func TryWebServerRestart ¶
func TryWebServerRestart()
func ValidateRequest ¶
func ValidateRequest(response http.ResponseWriter, request *http.Request) (*accounts.Account, error)
Return an account that matches, or issue an error
func WriteResponse ¶
func WriteResponse(response http.ResponseWriter, args ...interface{})
Types ¶
type Response ¶
type Response struct { Message string Reader io.ReadCloser }
func MakeRequest ¶
func MakeRequest(config *accounts.ClientConfig, request *jobs.Request) *Response
Make a request to the server
func NewResponse ¶
func NewResponse(message string, reader io.ReadCloser) *Response
Click to show internal directories.
Click to hide internal directories.