Update version info endpoint

This commits updates version endpoint to use ProviderInfo and VersionInfo structs from
faas-provider.GatewayInfo now uses ProviderInfo and VersionInfo structs. GatewayInfo is
left within gateway. Consumer of this endpoint should use typed struct GatewayInfo to
parse response.

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
This commit is contained in:
Vivek Singh
2021-01-18 09:34:54 +05:30
committed by Alex Ellis
parent 11d28b14cc
commit 82cd46ef2a
4 changed files with 12 additions and 32 deletions

View File

@ -1,25 +1,13 @@
package types
import providerTypes "github.com/openfaas/faas-provider/types"
// Platform architecture the gateway is running on
var Arch string
// GatewayInfo provides information about the gateway and it's connected components
type GatewayInfo struct {
Provider *ProviderInfo `json:"provider"`
Version *VersionInfo `json:"version"`
Arch string `json:"arch"`
}
// ProviderInfo provides information about the configured provider
type ProviderInfo struct {
Name string `json:"provider"`
Version *VersionInfo `json:"version"`
Orchestration string `json:"orchestration"`
}
// VersionInfo provides the commit message, sha and release version number
type VersionInfo struct {
CommitMessage string `json:"commit_message,omitempty"`
SHA string `json:"sha"`
Release string `json:"release"`
Provider *providerTypes.ProviderInfo `json:"provider"`
Version *providerTypes.VersionInfo `json:"version"`
Arch string `json:"arch"`
}