Documentation ¶
Overview ¶
Copyright Axis Communications AB.
For a full list of individual contributors, please see the commit history.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func New(cfg config.Config, log *logrus.Entry, ctx context.Context, ...) application.Application
- func RespondWithError(w http.ResponseWriter, code int, message string)
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- type Dataset
- type StartRequest
- type StartResponse
- type StatusRequest
- type StatusResponse
- type StopRequest
- type V1Alpha1Application
- type V1Alpha1Handler
- func (h V1Alpha1Handler) Selftest(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (h V1Alpha1Handler) Start(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h V1Alpha1Handler) Status(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h V1Alpha1Handler) Stop(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cfg config.Config, log *logrus.Entry, ctx context.Context, cli *clientv3.Client) application.Application
New returns a new V1Alpha1Application object/struct
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, message string)
RespondWithError writes a JSON response with an error message and status code to the HTTP ResponseWriter.
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON writes a JSON response with a status code to the HTTP ResponseWriter.
Types ¶
type StartRequest ¶
type StartRequest struct { MinimumAmount int `json:"minimum_amount"` MaximumAmount int `json:"maximum_amount"` ArtifactIdentity string `json:"identity"` ArtifactID string `json:"artifact_id"` ArtifactCreated eiffelevents.ArtifactCreatedV3 `json:"artifact_created,omitempty"` ArtifactPublished eiffelevents.ArtifactPublishedV3 `json:"artifact_published,omitempty"` TERCC eiffelevents.TestExecutionRecipeCollectionCreatedV4 `json:"tercc,omitempty"` Context uuid.UUID `json:"context,omitempty"` Dataset Dataset `json:"dataset,omitempty"` }
type StartResponse ¶
type StatusRequest ¶
type StatusResponse ¶
type StatusResponse struct { Id uuid.UUID `json:"id"` Status string `json:"status"` Iuts []packageurl.PackageURL `json:"iuts"` }
type StopRequest ¶
type V1Alpha1Application ¶
type V1Alpha1Application struct {
// contains filtered or unexported fields
}
func (*V1Alpha1Application) Close ¶
func (a *V1Alpha1Application) Close()
Close does nothing atm. Present for interface coherence
func (V1Alpha1Application) LoadRoutes ¶
func (a V1Alpha1Application) LoadRoutes(router *httprouter.Router)
LoadRoutes loads all the v1alpha1 routes.
type V1Alpha1Handler ¶
type V1Alpha1Handler struct {
// contains filtered or unexported fields
}
func (V1Alpha1Handler) Selftest ¶
func (h V1Alpha1Handler) Selftest(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Selftest is a handler to just return 204.
func (V1Alpha1Handler) Start ¶
func (h V1Alpha1Handler) Start(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Start creates a number of IUTs and stores them in the ETCD database returning a checkout ID.
func (V1Alpha1Handler) Status ¶
func (h V1Alpha1Handler) Status(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Status creates a simple DONE Status response with IUTs.
func (V1Alpha1Handler) Stop ¶
func (h V1Alpha1Handler) Stop(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Stop deletes the given IUTs from the database and returns an empty response.