Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const CLI_LOGO = `` /* 3893-byte string literal not displayed */
Logo format of SGI.
Variables ¶
View Source
var ( // Path to Working directory related to CLI tools. // The path is described relative to the HOME directory. CliDir = ".sgi" // Name of the file where the account information is stored. AccountFile = "account.json" )
Functions ¶
func PrintLogo ¶ added in v0.0.3
func PrintLogo()
Print the large logo of this cli tool. The logo consists of the Sakamichi-mark and this cli name(SGI). The format is defined at CLI_LOGO.
This function uses dimiron1/banner package. To get detailed information, please see: https://github.com/dimiro1/banner
func PrintTable ¶
Example ¶
package main import ( "github.com/android-project-46group/sgi-cli/util" ) func main() { var header []string var data [][]string header = []string{ "id", "name", } data = append(data, []string{ "1", "John", }) data = append(data, []string{ "2", "Doe", }) util.PrintTable(header, data) }
Output: +----+------+ | ID | NAME | +----+------+ | 1 | John | | 2 | Doe | +----+------+
Types ¶
type Account ¶
type Account struct { // BaseURL is the entrypoint of the api. BaseURL string // APIKey is needed to get information using API call APIKey string }
Account contains the settings for api.
type Config ¶
type Config struct { // Version is the application version. // Basically it consists of version and git-revision. Version string // Account contains the api settings of this cli Account Account }
Config contains the all settings for this cli. Create an instance of Config, by using NewConfig()
Click to show internal directories.
Click to hide internal directories.