util

package
v0.0.0-...-cc35533 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commit string

Commit is the commit this build comes from

View Source
var Name = "rack"

Name is the name of the CLI

View Source
var UserAgent = fmt.Sprintf("%s-%s/%s", "rackcli", runtime.GOOS, Version)

UserAgent is the user-agent used for each HTTP request

View Source
var Version string

Version is the current CLI version

Functions

func Contains

func Contains(s []string, e string) bool

Contains checks whether a given string is in a provided slice of strings.

func HomeDir

func HomeDir() (string, error)

HomeDir returns the user's home directory, which is platform-dependent.

func Pluralize

func Pluralize(noun string, count int64) string

Pluralize will plurarize a given noun according to its number. For example, 0 servers were deleted; 1 account updated.

func RackDir

func RackDir() (string, error)

RackDir returns the location of the `rack` directory. This directory is for storing `rack`-specific information such as the cache or a config file.

func RemoveFromList

func RemoveFromList(list []string, item string) []string

RemoveFromList removes an element from a slice and returns the slice.

func Usage

func Usage(commandPrefix, action, mandatoryFlags string) string

Usage return a string that specifies how to call a particular command.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL