Documentation ¶
Index ¶
- Constants
- Variables
- type ApiClient
- type ApiRequest
- type ApiRequester
- type ReportClient
- type Reporter
- type UpdateClient
- func (u *UpdateClient) DownloadUpdate(api ApiRequester, uri string, cr *httptoo.BytesContentRange) (io.ReadCloser, int64, error)
- func (u *UpdateClient) GetUpdateContentRange(api ApiRequester, uri string, start int64) (*httptoo.BytesContentRange, error)
- func (u *UpdateClient) ProbeUpdate(api ApiRequester, uri string, data interface{}) (interface{}, []byte, time.Duration, error)
- type Updater
Constants ¶
View Source
const ( UpgradesEndpoint = "/upgrades" StateReportEndpoint = "/report" )
Variables ¶
View Source
var ErrMaxRedirect = errors.New("Exceeded max redirects")
Functions ¶
This section is empty.
Types ¶
type ApiClient ¶
func NewApiClient ¶
func (*ApiClient) Request ¶
func (client *ApiClient) Request() *ApiRequest
type ApiRequest ¶
type ApiRequest struct {
// contains filtered or unexported fields
}
func (*ApiRequest) Client ¶
func (r *ApiRequest) Client() *ApiClient
type ApiRequester ¶
type ReportClient ¶
type ReportClient struct { }
func NewReportClient ¶
func NewReportClient() *ReportClient
func (*ReportClient) ReportState ¶
func (u *ReportClient) ReportState(api ApiRequester, packageUID string, previousState string, state string, errorMessage string, fm metadata.FirmwareMetadata) error
type Reporter ¶
type Reporter interface {
ReportState(api ApiRequester, packageUID string, previousState string, state string, errorMessage string, fm metadata.FirmwareMetadata) error
}
type UpdateClient ¶
type UpdateClient struct { }
func NewUpdateClient ¶
func NewUpdateClient() *UpdateClient
func (*UpdateClient) DownloadUpdate ¶
func (u *UpdateClient) DownloadUpdate(api ApiRequester, uri string, cr *httptoo.BytesContentRange) (io.ReadCloser, int64, error)
func (*UpdateClient) GetUpdateContentRange ¶
func (u *UpdateClient) GetUpdateContentRange(api ApiRequester, uri string, start int64) (*httptoo.BytesContentRange, error)
func (*UpdateClient) ProbeUpdate ¶
func (u *UpdateClient) ProbeUpdate(api ApiRequester, uri string, data interface{}) (interface{}, []byte, time.Duration, error)
type Updater ¶
type Updater interface { ProbeUpdate(api ApiRequester, uri string, data interface{}) (interface{}, []byte, time.Duration, error) DownloadUpdate(api ApiRequester, uri string, cr *httptoo.BytesContentRange) (io.ReadCloser, int64, error) GetUpdateContentRange(api ApiRequester, uri string, start int64) (*httptoo.BytesContentRange, error) }
Click to show internal directories.
Click to hide internal directories.