Documentation
¶
Index ¶
- Variables
- type Backend
- type Endpoints
- func (e Endpoints) GetController(ctx context.Context, bid string) (hawkbit.Controller, error)
- func (e Endpoints) GetDeployBase(ctx context.Context, bid, acid string) (hawkbit.DeploymentBase, error)
- func (e Endpoints) GetDownloadHttp(ctx context.Context, bid, ver string) []byte
- func (e Endpoints) PostDeployBaseFeedback(ctx context.Context, bid string, fb hawkbit.DeploymentBaseFeedback) error
- func (e Endpoints) PutConfigData(ctx context.Context, bid string, cfg hawkbit.ConfigData) error
- type IService
- type Middleware
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBackendPortOpen = errors.New("Backend: port open error") ErrBackendPortClose = errors.New("Backend: port close error") ErrBackendPortFlush = errors.New("Backend: port flush error") ErrBackendPort = errors.New("Backend: invalid port setting") ErrBackendImage = errors.New("Backend: invalid image") ErrBackendReset = errors.New("Backend: failed to reset") )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
Handler(port string, baud int, url string) error
UploadImage(f []byte) error
Reset()
GetStatus() (exec, result string)
}
func NewMCUMgrBackend ¶
func NewMCUMgrBackend() Backend
type Endpoints ¶
type Endpoints struct {
GetControllerEndpoint endpoint.Endpoint
PutConfigDataEndpoint endpoint.Endpoint
GetDeployBaseEndpoint endpoint.Endpoint
PostDeployBaseFeedbackEndpoint endpoint.Endpoint
GetDownloadHttpEndpoint endpoint.Endpoint
}
func (Endpoints) GetController ¶
func (Endpoints) GetDeployBase ¶
func (Endpoints) GetDownloadHttp ¶
func (Endpoints) PostDeployBaseFeedback ¶
func (Endpoints) PutConfigData ¶
type IService ¶
type IService interface {
GetController(ctx context.Context, bid string) (hawkbit.Controller, error)
PutConfigData(ctx context.Context, bid string, cfg hawkbit.ConfigData) error
GetDeployBase(ctx context.Context, bid, acid string) (hawkbit.DeploymentBase, error)
PostDeployBaseFeedback(ctx context.Context, bid string, fb hawkbit.DeploymentBaseFeedback) error
GetDownloadHttp(ctx context.Context, bid, ver string) []byte
}
func NewHTTPClient ¶
func NewHTTPClient(instance string, otTracer stdopentracing.Tracer, logger log.Logger) (IService, error)
NewHTTPClient returns an AddService backed by an HTTP server living at the remote instance. We expect instance to come from a service discovery system, so likely of the form "host:port". We bake-in certain middlewares, implementing the client library pattern.
type Middleware ¶
Middleware describes a service (as opposed to endpoint) middleware.
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
Click to show internal directories.
Click to hide internal directories.