Documentation ¶
Index ¶
Constants ¶
View Source
const (
// HeaderSabactlUser is the HTTP header name to tell which user run sabactl.
HeaderSabactlUser = "X-Sabakan-User"
)
Variables ¶
View Source
var ( APIErrBadRequest = APIError{http.StatusBadRequest, "invalid request", nil} APIErrForbidden = APIError{http.StatusForbidden, "forbidden", nil} APIErrNotFound = APIError{http.StatusNotFound, "requested resource is not found", nil} APIErrBadMethod = APIError{http.StatusMethodNotAllowed, "method not allowed", nil} APIErrConflict = APIError{http.StatusConflict, "conflicted", nil} APIErrLengthRequired = APIError{http.StatusLengthRequired, "content-length is required", nil} APIErrTooLargeAsset = APIError{http.StatusRequestEntityTooLarge, "too large asset", nil} )
Common API errors
Functions ¶
This section is empty.
Types ¶
type APIError ¶
APIError is to define REST API errors.
func BadRequest ¶
BadRequest creates an APIError that describes what was bad in the request.
func InternalServerError ¶
InternalServerError creates an APIError.
type Server ¶
type Server struct { Model sabakan.Model MyURL *url.URL MyURLHTTPS *url.URL IPXEFirmware string CryptSetup string AllowedRemotes []*net.IPNet Counter *metrics.APICounter TLSServer bool // contains filtered or unexported fields }
Server is the sabakan server.
Click to show internal directories.
Click to hide internal directories.