api

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

ErrorResponse represents an API response

type Service

type Service struct {
	StartTime time.Time
}

Service encapsulates API service operations

func (Service) GetVersionInfoForPackage

func (service Service) GetVersionInfoForPackage(rw http.ResponseWriter, req *http.Request)

GetVersionInfoForPackage godoc @Summary gets the version information for the given package @Description gets the version information for the given package @Tags package @Accept json @Produce json @Param package path string true "The package to get information for" @Success 200 {object} api.SystemResponse @Failure 404 {object} api.ErrorResponse @Failure 424 {object} api.ErrorResponse @Failure 500 {object} api.ErrorResponse @Router /package/{package}/info [get]

func (Service) UpdatePackageToVersion added in v1.0.10

func (service Service) UpdatePackageToVersion(rw http.ResponseWriter, req *http.Request)

UpdatePackageToVersion godoc @Summary updates a package to the specified version @Description updates a package to the specified version @Tags package @Accept json @Produce json @Param package path string true "The package to update" @Param version path string true "The version to update to" @Success 200 {object} api.SystemResponse @Failure 404 {object} api.ErrorResponse @Failure 424 {object} api.ErrorResponse @Failure 500 {object} api.ErrorResponse @Router /package/{package}/updatetoversion/{version} [post]

type SystemResponse

type SystemResponse struct {
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

SystemResponse is a response for a system request

type VersionReport

type VersionReport struct {
	Name              string            `json:"name"`              // The package name
	InstalledVersion  string            `json:"installedversion"`  // The current (installed) version of the package
	LatestVersion     string            `json:"latestversion"`     // The latest available version of the package
	UpdateDownloadUrl string            `json:"latestdownloadurl"` // The url to get the latest update
	PreviousVersions  map[string]string `json:"previousversions"`  // Previous versions available
	UpgradeAvailable  bool              `json:"upgradeavailable"`  // 'true' if there is an upgrade available
}

VersionReport defines version information for a given package

Jump to

Keyboard shortcuts

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