Documentation
¶
Index ¶
- Variables
- func BadRequestResponse(c *gin.Context, err error)
- func BearerAuth(auth *auth.AuthTokenDB, handler gin.HandlerFunc) gin.HandlerFunc
- func ServiceUnavailableResponse(c *gin.Context, err error)
- func UnprocessableEntityResponse(c *gin.Context, message string)
- type Application
- type BuildRequest
- type ErrorResponse
- type ValidationErrorResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBadBearerToken = errors.New("missing or incorrectly formatted bearer token")
)
View Source
var (
ErrInvalidRequest = errors.New("invalid request")
)
Functions ¶
func BadRequestResponse ¶ added in v0.0.6
func BearerAuth ¶ added in v0.0.5
func BearerAuth(auth *auth.AuthTokenDB, handler gin.HandlerFunc) gin.HandlerFunc
func ServiceUnavailableResponse ¶ added in v0.0.6
func UnprocessableEntityResponse ¶ added in v0.0.6
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func New ¶
func New(art *artifactory.Artifactory, auth *auth.AuthTokenDB, workers *processor.WorkerDB, ) *Application
func (*Application) Start ¶
func (app *Application) Start(listen string) error
type BuildRequest ¶ added in v0.0.6
type BuildRequest struct {
CommitHash string `json:"commit_hash"`
Flags []firmware.BuildFlag `json:"flags"`
}
func (*BuildRequest) Validate ¶ added in v0.0.6
func (req *BuildRequest) Validate() []error
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
func NewErrorResponse ¶
func NewErrorResponse(message string) *ErrorResponse
type ValidationErrorResponse ¶
type ValidationErrorResponse struct {
Error string `json:"error"`
ValidationErrors []string `json:"validation_errors"`
}
func NewValidationErrorResponse ¶
func NewValidationErrorResponse(message string, errs []error) *ValidationErrorResponse
Click to show internal directories.
Click to hide internal directories.