github.heygears.com/openimsdk/tools@v0.0.49/version/types.go (about)

     1  // Copyright © 2023 OpenIM. All rights reserved.
     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  	GitTreeState string `json:"gitTreeState,omitempty"`
    25  	GitCommit    string `json:"gitCommit,omitempty"`
    26  	BuildDate    string `json:"buildDate"`
    27  	GoVersion    string `json:"goVersion"`
    28  	Compiler     string `json:"compiler"`
    29  	Platform     string `json:"platform"`
    30  }
    31  
    32  type Output struct {
    33  	OpenIMServerVersion Info                 `json:"OpenIMServerVersion,omitempty" yaml:"OpenIMServerVersion,omitempty"`
    34  	OpenIMClientVersion *OpenIMClientVersion `json:"OpenIMClientVersion,omitempty" yaml:"OpenIMClientVersion,omitempty"`
    35  }
    36  
    37  type OpenIMClientVersion struct {
    38  	ClientVersion string `json:"clientVersion,omitempty" yaml:"clientVersion,omitempty"` // sdk core version
    39  }
    40  
    41  // String returns info as a human-friendly version string.
    42  func (info Info) String() string {
    43  	return info.GitVersion
    44  }