share

package
v0.0.0-...-6a8e38e Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

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 AsHaString(val int) string

func AsInt

func AsInt(val interface{}) int

func AsPsString

func AsPsString(val int) string

func AsString

func AsString(val interface{}) string

func ByteSize

func ByteSize(bytes uint64) string

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 CallFarUpload(url string, flags FatimaCmdFlags, desc map[string]interface{}, path string) (http.Header, []byte, error)

func CallFatimaApi

func CallFatimaApi(url string, flags FatimaCmdFlags, b []byte) (http.Header, []byte, error)

func GetInt

func GetInt(m map[string]interface{}, key string) int

func GetJunoEndpoint

func GetJunoEndpoint(flags *FatimaCmdFlags) error

func GetKeyInMap

func GetKeyInMap(sourceMap map[string]interface{}, findingKey string) string

GetKeyInMap get key(path) in map. e.g) findingKey = "data.sub.myKey"

func GetList

func GetList(m map[string]interface{}, key string) []interface{}

func GetMap

func GetMap(m map[string]interface{}, key string) map[string]interface{}

func GetString

func GetString(m map[string]interface{}, key string) string

func GetStringFromHeader

func GetStringFromHeader(header http.Header, key string) string

func GetSummaryHistory

func GetSummaryHistory(m map[string]interface{}) []interface{}

func GetSummaryMessage

func GetSummaryMessage(m map[string]interface{}) string

func GetSystemMessage

func GetSystemMessage(m map[string]interface{}) string

func GetToken

func GetToken(flags *FatimaCmdFlags) error

func IsFileExist

func IsFileExist(path string) bool

func PrintPreface

func PrintPreface(respHeader http.Header, body map[string]interface{})

func PrintTable

func PrintTable(headers []string, data [][]string)

func ToBytes

func ToBytes(s string) (uint64, error)

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

func ToMegabytes(s string) (uint64, error)

ToMegabytes parses a string formatted by ByteSize as megabytes.

Types

type CustomBodyReader

type CustomBodyReader struct {
	// contains filtered or unexported fields
}

func (*CustomBodyReader) Read

func (c *CustomBodyReader) Read(p []byte) (n int, err error)

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

type PackageInfo struct {
	Group    string
	Host     string
	Name     string
	Platform string
}

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

Jump to

Keyboard shortcuts

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