api,database: updated version_format documentation.

Version format documentation is updated in the example of feature
struct and created in clair.proto along with accordingly generated
swagger and protobuf files.

Fixes #514
This commit is contained in:
Sida Chen 2018-02-02 00:53:40 -05:00
parent 52a42b8503
commit a75b8ac7ff
4 changed files with 12 additions and 6 deletions

View File

@ -158,9 +158,11 @@ func (m *ClairStatus) GetLastUpdateTime() *google_protobuf2.Timestamp {
}
type Feature struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName" json:"namespace_name,omitempty"`
Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"`
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
NamespaceName string `protobuf:"bytes,2,opt,name=namespace_name,json=namespaceName" json:"namespace_name,omitempty"`
Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"`
// version_format is the format used by installer package manager to store
// package versions.
VersionFormat string `protobuf:"bytes,4,opt,name=version_format,json=versionFormat" json:"version_format,omitempty"`
Vulnerabilities []*Vulnerability `protobuf:"bytes,5,rep,name=vulnerabilities" json:"vulnerabilities,omitempty"`
}

View File

@ -45,6 +45,9 @@ message Feature{
string name = 1;
string namespace_name = 2;
string version = 3;
// version_format is the format used by installer package manager to store
// package versions.
string version_format = 4;
repeated Vulnerability vulnerabilities = 5;
}

View File

@ -232,7 +232,8 @@
"type": "string"
},
"version_format": {
"type": "string"
"type": "string",
"description": "version_format is the format used by installer package manager to store\npackage versions."
},
"vulnerabilities": {
"type": "array",

View File

@ -71,8 +71,8 @@ type Namespace struct {
// determined.
//
// e.g. Name: OpenSSL, Version: 1.0, VersionFormat: dpkg.
// dpkg implies the installer package manager but the namespace (might be
// debian:7, debian:8, ...) could not be determined.
// dpkg is the version format of the installer package manager, which in this
// case could be dpkg or apk.
type Feature struct {
Name string
Version string