Documentation ¶
Index ¶
- Variables
- func MakeBackendHTTPHandler(s BackendService, logger log.Logger) http.Handler
- func MakeGetControllerEndpoint(s BackendService) endpoint.Endpoint
- func MakeGetDeploymentBaseEndpoint(s BackendService) endpoint.Endpoint
- func MakeGetDownloadHttpEndpoint(s BackendService) endpoint.Endpoint
- func MakePostCancelActionFeedbackEndpoint(s BackendService) endpoint.Endpoint
- func MakePostDeploymentBaseFeedbackEndpoint(s BackendService) endpoint.Endpoint
- func MakePutConfigDataEndpoint(s BackendService) endpoint.Endpoint
- type BackendService
- type CancelActionFeedback
- type ConfigData
- type Controller
- type DeploymentBase
- type DeploymentBaseFeedback
- type Endpoints
- type GetControllerRequest
- type GetControllerResponse
- type GetDeplymentBaseRequest
- type GetDeplymentBaseResponse
- type GetDownloadHttpRequest
- type GetDownloadHttpResponse
- type Middleware
- type PostCancelActionFeedbackRequest
- type PostCancelActionFeedbackResponse
- type PostDeploymentBaseFeedbackRequest
- type PostDeploymentBaseFeedbackResponse
- type PutConfigDataRequest
- type PutConfigDataResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBackendDownload = errors.New("Backend: image download failed") ErrBackendBadRequest = errors.New("Backend: bad request") )
View Source
var ( // ErrBadRouting is returned when an expected path variable is missing. // It always indicates programmer error. ErrBadRouting = errors.New("inconsistent mapping between route and handler (programmer error)") )
Functions ¶
func MakeBackendHTTPHandler ¶
func MakeBackendHTTPHandler(s BackendService, logger log.Logger) http.Handler
func MakeGetControllerEndpoint ¶
func MakeGetControllerEndpoint(s BackendService) endpoint.Endpoint
func MakeGetDeploymentBaseEndpoint ¶
func MakeGetDeploymentBaseEndpoint(s BackendService) endpoint.Endpoint
func MakeGetDownloadHttpEndpoint ¶
func MakeGetDownloadHttpEndpoint(s BackendService) endpoint.Endpoint
func MakePostCancelActionFeedbackEndpoint ¶
func MakePostCancelActionFeedbackEndpoint(s BackendService) endpoint.Endpoint
func MakePostDeploymentBaseFeedbackEndpoint ¶
func MakePostDeploymentBaseFeedbackEndpoint(s BackendService) endpoint.Endpoint
func MakePutConfigDataEndpoint ¶
func MakePutConfigDataEndpoint(s BackendService) endpoint.Endpoint
Types ¶
type BackendService ¶
type BackendService interface { GetController(ctx context.Context, bid string) (Controller, error) PostCancelActionFeedback(ctx context.Context, bid string, fb CancelActionFeedback) error PutConfigData(ctx context.Context, bid string, cfg ConfigData) error GetDeplymentBase(ctx context.Context, bid string, acid string) (DeploymentBase, error) PostDeploymentBaseFeedback(ctx context.Context, bid string, fb DeploymentBaseFeedback) error GetDownloadHttp(ctx context.Context, bid string, ver string) ([]byte, error) }
func NewHawkbitBackendService ¶
func NewHawkbitBackendService() BackendService
type CancelActionFeedback ¶
type ConfigData ¶
type ConfigData struct { Mode string `json:"mode"` Data struct { VIN string `json:"vin"` HwRevision string `json:"hwRevision"` } `json:"data"` ID string `json:"id"` Time string `json:"time"` Status struct { Execution string `json:"execution"` Result struct { Finished string `json:"finished"` } `json:"result"` } `json:"status"` }
type Controller ¶
type Controller struct { Config struct { Polling struct { Sleep string `json:"sleep"` } `json:"polling"` } `json:"config"` Links struct { DeploymentBase struct { Href string `json:"href"` } `json:"deploymentBase"` CancelAction struct { Href string `json:"href"` } `json:"cancelAction"` ConfigData struct { Href string `json:"href"` } `json:"configData"` } `json:"_links"` }
type DeploymentBase ¶
type DeploymentBaseFeedback ¶
type Endpoints ¶
type Endpoints struct { GetControllerEndpoint endpoint.Endpoint PostCancelActionFeebackEndpoint endpoint.Endpoint PutConfigDataEndpoint endpoint.Endpoint GetDeploymentBaseEndpoint endpoint.Endpoint PostDeploymentBaseFeedbackEndpoint endpoint.Endpoint GetDownloadHttpEndpoint endpoint.Endpoint }
func MakeBackendServerEndpoints ¶
func MakeBackendServerEndpoints(s BackendService) Endpoints
type GetControllerRequest ¶
type GetControllerRequest struct {
Bid string
}
type GetControllerResponse ¶
type GetControllerResponse struct { Ctrlr Controller `json:"controller"` Err error `json:"err,omitempty"` }
type GetDeplymentBaseRequest ¶
type GetDeplymentBaseResponse ¶
type GetDeplymentBaseResponse struct { Dp DeploymentBase `json:"deploymentBase,omitempty"` Err error `json:"err,omitempty"` }
type GetDownloadHttpRequest ¶
type GetDownloadHttpResponse ¶
type GetDownloadHttpResponse struct {
File []byte
}
type Middleware ¶
type Middleware func(BackendService) BackendService
Middleware describes a BackendService (as opposed to endpoint) middleware.
func LoggingBackendMiddleware ¶
func LoggingBackendMiddleware(logger log.Logger) Middleware
type PostCancelActionFeedbackRequest ¶
type PostCancelActionFeedbackRequest struct { Bid string Fb CancelActionFeedback `json:"cancelActionFeedback,omitempty"` }
type PostCancelActionFeedbackResponse ¶
type PostCancelActionFeedbackResponse struct {
Err error `json:"err,omitempty"`
}
type PostDeploymentBaseFeedbackRequest ¶
type PostDeploymentBaseFeedbackRequest struct { Bid string Fb DeploymentBaseFeedback `json:"deploymentBaseFeedback,omitempty"` }
type PostDeploymentBaseFeedbackResponse ¶
type PostDeploymentBaseFeedbackResponse struct {
Err error `json:"err,omitempty"`
}
type PutConfigDataRequest ¶
type PutConfigDataRequest struct { Bid string Cfg ConfigData `json:"configData,omitempty"` }
type PutConfigDataResponse ¶
type PutConfigDataResponse struct {
Err error `json:"err,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.