Documentation
¶
Index ¶
- type ArchAndOS
- type Service
- func (svc *Service) HealthHandler(ginCtx *gin.Context)
- func (svc *Service) IsHealthy() bool
- func (svc *Service) PatchUpdateHandler(ginCtx *gin.Context)
- func (svc *Service) RegisterShutdown()
- func (svc *Service) RootHandler(ginCtx *gin.Context)
- func (svc *Service) Run(config *ServiceConfig) error
- func (svc *Service) SignedPatchUpdateHandler(ginCtx *gin.Context)
- func (svc *Service) SignedUpdateHandler(ginCtx *gin.Context)
- func (svc *Service) UpdateHandler(ginCtx *gin.Context)
- func (svc *Service) UploadHandler(ginCtx *gin.Context)
- type ServiceConfig
- type Update
- type UploadData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { Healthy bool // contains filtered or unexported fields }
Service is the main struct
func NewService ¶
func NewService() *Service
func (*Service) HealthHandler ¶
HealthHandler handles /healthz endpoint
func (*Service) PatchUpdateHandler ¶ added in v0.0.2
PatchUpdateHandler handles /patch-update/:name endpoint TODO: use file cache to read and store binarydiff
func (*Service) RegisterShutdown ¶
func (svc *Service) RegisterShutdown()
func (*Service) RootHandler ¶
RootHandler handles / endpoint
func (*Service) Run ¶
func (svc *Service) Run(config *ServiceConfig) error
Run is the main function of the server. It bootstraps the service and creates the route endpoints.
func (*Service) SignedPatchUpdateHandler ¶ added in v0.0.3
SignedPatchUpdateHandler handles /signed-patch-update/:name endpoint
func (*Service) SignedUpdateHandler ¶ added in v0.0.2
SignedUpdateHandler handles /signed-update/:name endpoint
func (*Service) UpdateHandler ¶
UpdateHandler handles /update/:name endpoint
func (*Service) UploadHandler ¶ added in v0.0.4
UploadHandler handles /upload/:name endpoint
type ServiceConfig ¶
type ServiceConfig struct { Config *conf.Config OAuth2Endpoints oauth2.Endpoint CertKeyPair tls.Certificate Httponly bool }
ServiceConfig contains everything configurable for the service endpoint.
type Update ¶
func (*Update) GetFilepath ¶ added in v0.0.3
func (*Update) GetLatestVersion ¶ added in v0.0.2
type UploadData ¶ added in v0.0.4
type UploadData struct { Data []byte `json:"data"` // the new binary version Version string `json:"version"` // version string Architecture string `json:"arch"` // architecture, p.e. amd64 OS string `json:"os"` // operating system, p.e. linux Signature []byte `json:"signature,omitempty"` // DER encoded signature SignatureType string `json:"signature-type,omitempty"` // ecdsa }
UploadData represents all the data needed to provide update, patch update, signed update or signed patch update. You need to sign your data if you want to provide signed updates.
func (*UploadData) Save ¶ added in v0.0.4
func (ud *UploadData) Save(application string) error