{"modulePath":"github.com/szuecs/binary-patch","version":"v0.0.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Types\n\n```go\ntype ArchAndOS struct {\n\tArch string // GOARCH\n\tOS   string // GOOS\n}\n```\n\n```go\ntype Service struct {\n\tHealthy bool\n\t// contains filtered or unexported fields\n}\n```\nService is the main struct\n\n```go\nfunc NewService() *Service\n```\n\n```go\nfunc (svc *Service) HealthHandler(ginCtx *gin.Context)\n```\nHealthHandler handles /healthz endpoint\n\n```go\nfunc (svc *Service) IsHealthy() bool\n```\nIsHealthy returns the health status of the running service.\n\n```go\nfunc (svc *Service) PatchUpdateHandler(ginCtx *gin.Context)\n```\nPatchUpdateHandler handles /patch-update/:name endpoint TODO: use file cache to read and store binarydiff\n\n```go\nfunc (svc *Service) RegisterShutdown()\n```\n\n```go\nfunc (svc *Service) RootHandler(ginCtx *gin.Context)\n```\nRootHandler handles / endpoint\n\n```go\nfunc (svc *Service) Run(config *ServiceConfig) error\n```\nRun is the main function of the server. It bootstraps the service and creates the route endpoints.\n\n```go\nfunc (svc *Service) SignedPatchUpdateHandler(ginCtx *gin.Context)\n```\nSignedPatchUpdateHandler handles /signed-patch-update/:name endpoint\n\n```go\nfunc (svc *Service) SignedUpdateHandler(ginCtx *gin.Context)\n```\nSignedUpdateHandler handles /signed-update/:name endpoint\n\n```go\nfunc (svc *Service) UpdateHandler(ginCtx *gin.Context)\n```\nUpdateHandler handles /update/:name endpoint\n\n```go\nfunc (svc *Service) UploadHandler(ginCtx *gin.Context)\n```\nUploadHandler handles /upload/:name endpoint\n\n```go\ntype ServiceConfig struct {\n\tConfig          *conf.Config\n\tOAuth2Endpoints oauth2.Endpoint\n\tCertKeyPair     tls.Certificate\n\tHttponly        bool\n}\n```\nServiceConfig contains everything configurable for the service endpoint.\n\n```go\ntype Update struct {\n\tName    string\n\tVersion string\n\tSystem  ArchAndOS\n}\n```\n\n```go\nfunc (u *Update) Clone() *Update\n```\n\n```go\nfunc (u *Update) GetFilepath() string\n```\n\n```go\nfunc (u *Update) GetLatestVersion() string\n```\n\n```go\nfunc (u *Update) GetReader(filepath string) (io.ReadCloser, error)\n```\n\n```go\nfunc (u *Update) String() string\n```\n\n```go\ntype UploadData struct {\n\tData          []byte `json:\"data\"`                     // the new binary version\n\tVersion       string `json:\"version\"`                  // version string\n\tArchitecture  string `json:\"arch\"`                     // architecture, p.e. amd64\n\tOS            string `json:\"os\"`                       // operating system, p.e. linux\n\tSignature     []byte `json:\"signature,omitempty\"`      // DER encoded signature\n\tSignatureType string `json:\"signature-type,omitempty\"` // ecdsa\n}\n```\nUploadData 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.\n\n```go\nfunc (ud *UploadData) Save(application string) error\n```\n\n```go\nfunc (ud *UploadData) Write(filepath string, data []byte) error\n```\n\n","path":"github.com/szuecs/binary-patch/api","name":"api","synopsis":"","isRedistributable":true}
