api

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2017 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchAndOS

type ArchAndOS struct {
	Arch string // GOARCH
	OS   string // GOOS
}

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

func (svc *Service) HealthHandler(ginCtx *gin.Context)

HealthHandler handles /healthz endpoint

func (*Service) IsHealthy

func (svc *Service) IsHealthy() bool

IsHealthy returns the health status of the running service.

func (*Service) PatchUpdateHandler added in v0.0.2

func (svc *Service) PatchUpdateHandler(ginCtx *gin.Context)

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

func (svc *Service) RootHandler(ginCtx *gin.Context)

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

func (svc *Service) SignedPatchUpdateHandler(ginCtx *gin.Context)

SignedPatchUpdateHandler handles /signed-patch-update/:name endpoint

func (*Service) SignedUpdateHandler added in v0.0.2

func (svc *Service) SignedUpdateHandler(ginCtx *gin.Context)

SignedUpdateHandler handles /signed-update/:name endpoint

func (*Service) UpdateHandler

func (svc *Service) UpdateHandler(ginCtx *gin.Context)

UpdateHandler handles /update/: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

type Update struct {
	Name    string
	Version string
	System  ArchAndOS
}

func (*Update) Clone added in v0.0.2

func (u *Update) Clone() *Update

func (*Update) GetFilepath added in v0.0.3

func (u *Update) GetFilepath() string

func (*Update) GetLatestVersion added in v0.0.2

func (u *Update) GetLatestVersion() string

func (*Update) GetReader

func (u *Update) GetReader(filepath string) (io.ReadCloser, error)

func (*Update) String

func (u *Update) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL