github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/version/types.go (about)

     1  // Copyright © 2021 Alibaba Group Holding Ltd.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package version
    16  
    17  // Info contains versioning information.
    18  // TODO: Add []string of api versions supported? It's still unclear
    19  // how we'll want to distribute that information.
    20  type Info struct {
    21  	Major      string `json:"major,omitempty"`
    22  	Minor      string `json:"minor,omitempty"`
    23  	GitVersion string `json:"gitVersion"`
    24  	GitCommit  string `json:"gitCommit,omitempty"`
    25  	BuildDate  string `json:"buildDate"`
    26  	GoVersion  string `json:"goVersion"`
    27  	Compiler   string `json:"compiler"`
    28  	Platform   string `json:"platform"`
    29  }
    30  
    31  // String returns info as a human-friendly version string.
    32  func (info Info) String() string {
    33  	return info.GitVersion
    34  }