github.com/decred/politeia@v1.4.0/politeiawww/cmd/shared/version.go (about) 1 // Copyright (c) 2017-2019 The Decred developers 2 // Use of this source code is governed by an ISC 3 // license that can be found in the LICENSE file. 4 5 package shared 6 7 // VersionCmd retrieves the server version information and CSRF token. 8 type VersionCmd struct{} 9 10 // Execute executes the version command. 11 func (cmd *VersionCmd) Execute(args []string) error { 12 vr, err := client.Version() 13 if err != nil { 14 return err 15 } 16 return PrintJSON(vr) 17 } 18 19 // VersionHelpMsg is the output of the help command when 'version' is 20 // specified. 21 const VersionHelpMsg = `version 22 23 Fetch server version info and CSRF token. 24 25 Arguments: None 26 27 Result: 28 { 29 "version": (string) Version of backend 30 "route": (string) Version route 31 "pubkey": (string) Server public key 32 "testnet": (bool) Whether of not testnet is being used 33 }`