Documentation
¶
Index ¶
- Constants
- Variables
- func AsHaString(val int) string
- func AsInt(val interface{}) int
- func AsPsString(val int) string
- func AsString(val interface{}) string
- func ByteSize(bytes uint64) string
- func CallFarUpload(url string, flags FatimaCmdFlags, desc map[string]interface{}, path string) (http.Header, []byte, error)
- func CallFatimaApi(url string, flags FatimaCmdFlags, b []byte) (http.Header, []byte, error)
- func GetInt(m map[string]interface{}, key string) int
- func GetJunoEndpoint(flags *FatimaCmdFlags) error
- func GetKeyInMap(sourceMap map[string]interface{}, findingKey string) string
- func GetList(m map[string]interface{}, key string) []interface{}
- func GetMap(m map[string]interface{}, key string) map[string]interface{}
- func GetString(m map[string]interface{}, key string) string
- func GetStringFromHeader(header http.Header, key string) string
- func GetSummaryHistory(m map[string]interface{}) []interface{}
- func GetSummaryMessage(m map[string]interface{}) string
- func GetSystemMessage(m map[string]interface{}) string
- func GetToken(flags *FatimaCmdFlags) error
- func IsFileExist(path string) bool
- func PrintPreface(respHeader http.Header, body map[string]interface{})
- func PrintTable(headers []string, data [][]string)
- func ToBytes(s string) (uint64, error)
- func ToMegabytes(s string) (uint64, error)
- type CustomBodyReader
- type FatimaCmdFlags
- type PackageInfo
Constants ¶
View Source
const ( EnvFatimaHome = "FATIMA_HOME" EnvFatimaProfile = "FATIMA_PROFILE" EnvFatimaRepositoryUri = "FATIMA_REPOSITORY_URI" EnvFatimaJupiterUri = "FATIMA_JUPITER_URI" EnvFatimaUsername = "FATIMA_USERNAME" EnvFatimaPassword = "FATIMA_PASSWORD" EnvFatimaTimezone = "FATIMA_TIMEZONE" FatimaFolderApp = "app" FatimaFolderAppProc = "proc" FatimaFolderRevision = "revision" FatimaShellGoaway = "goaway.sh" )
View Source
const ( BYTE = 1.0 << (10 * iota) KILOBYTE MEGABYTE GIGABYTE TERABYTE )
Variables ¶
View Source
var ( ErrInvalidFatimaUsername = errors.New("you must provide a username via either -fu or env[FATIMA_USERNAME]") ErrInvalidFatimaPassword = errors.New("you must provide a password via either -fp or env[FATIMA_PASSWORD]") ErrInvalidFatimaJupiterUri = errors.New("you must provide a uri to fatima jupiter via either -fj or env[FATIMA_JUPITER_URI]") )
Functions ¶
func AsHaString ¶
func AsPsString ¶
func ByteSize ¶
ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth. The following units are available:
T: Terabyte G: Gigabyte M: Megabyte K: Kilobyte B: Byte
The unit that results in the smallest number greater than or equal to 1 is always chosen.
func CallFarUpload ¶
func CallFatimaApi ¶
func GetJunoEndpoint ¶
func GetJunoEndpoint(flags *FatimaCmdFlags) error
func GetKeyInMap ¶
GetKeyInMap get key(path) in map. e.g) findingKey = "data.sub.myKey"
func GetSummaryHistory ¶
func GetSummaryHistory(m map[string]interface{}) []interface{}
func GetSummaryMessage ¶
func GetSystemMessage ¶
func GetToken ¶
func GetToken(flags *FatimaCmdFlags) error
func IsFileExist ¶
func PrintPreface ¶
func PrintTable ¶
func ToBytes ¶
ToBytes parses a string formatted by ByteSize as bytes. Note binary-prefixed and SI prefixed units both mean a base-2 units KB = K = KiB = 1024 MB = M = MiB = 1024 * K GB = G = GiB = 1024 * M TB = T = TiB = 1024 * G
func ToMegabytes ¶
ToMegabytes parses a string formatted by ByteSize as megabytes.
Types ¶
type CustomBodyReader ¶
type CustomBodyReader struct {
// contains filtered or unexported fields
}
type FatimaCmdFlags ¶
type FatimaCmdFlags struct {
Username string
Password string
JupiterUri string
Timezone string
Debug bool
UserPackage string
Args []string
Token string
Endpoint string
}
func BuildFatimaCmdFlags ¶
func BuildFatimaCmdFlags() (FatimaCmdFlags, error)
func (FatimaCmdFlags) BuildHeader ¶
func (c FatimaCmdFlags) BuildHeader() map[string]string
func (FatimaCmdFlags) BuildJunoServiceUrl ¶
func (c FatimaCmdFlags) BuildJunoServiceUrl(url string) string
func (FatimaCmdFlags) BuildJupiterServiceUrl ¶
func (c FatimaCmdFlags) BuildJupiterServiceUrl(url string) string
func (FatimaCmdFlags) GetEncryptedPassword ¶
func (c FatimaCmdFlags) GetEncryptedPassword() string
func (FatimaCmdFlags) Validate ¶
func (c FatimaCmdFlags) Validate() error
type PackageInfo ¶
func NewPackageInfo ¶
func NewPackageInfo(m map[string]interface{}) PackageInfo
func (PackageInfo) String ¶
func (p PackageInfo) String() string
func (PackageInfo) Valid ¶
func (p PackageInfo) Valid() bool
Click to show internal directories.
Click to hide internal directories.