util

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: EPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Code generated by rice embed-go; DO NOT EDIT.

Index

Constants

View Source
const Alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
View Source
const AlphaLower = "abcdefghijklmnopqrstuvwxyz"
View Source
const AlphaNum = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
View Source
const CDeepskyblue = "\033[48;5;25m"
View Source
const CSkyblue = "\033[38;5;117m"
View Source
const Green = "\033[38;5;28m"
View Source
const LastSystemCatalogItemID int = 3
View Source
const NoFormat = "\033[0m"

These are the colors we'll use in pretty printing output

View Source
const Red = "\033[38;5;1m"

Variables

This section is empty.

Functions

func ActivateAndGetAccessToken added in v1.1.0

func ActivateAndGetAccessToken(productID, activationCode, seatID, seatName string) (string, string, error)

func AddTrailingSlash

func AddTrailingSlash(in string) string

func After

func After(input, substr string) string

func AfterLast

func AfterLast(input, substr string) string

func Before

func Before(input, substr string) string

func Check

func Check(err error)

Check error and exit

func CheckExpiryDate added in v1.1.0

func CheckExpiryDate(dateString string) bool

func CheckNumOfAgentSeats added in v1.1.0

func CheckNumOfAgentSeats(currentAgentNum int, maxAgentNum string) bool

func DeactivateEntitlementDatasance added in v1.1.0

func DeactivateEntitlementDatasance(activationCode string, seatID string, seatName string)

func DeactivateLicense added in v1.1.0

func DeactivateLicense(accessToken, nonce string)

func ElapsedRFC

func ElapsedRFC(from, to string) (diff string, err error)

func ElapsedUTC

func ElapsedUTC(from, to string) (diff string, err error)

func Exec

func Exec(env, cmdName string, args ...string) (stdout bytes.Buffer, err error)

Exec command

func FPrint

func FPrint(obj interface{}, filename string) error

func FirstToUpper

func FirstToUpper(in string) (out string)

func FormatDuration

func FormatDuration(duration time.Duration) string

func FormatPath

func FormatPath(input string) (string, error)

func FromIntUTC

func FromIntUTC(sec int64) string

func GetAgentImage

func GetAgentImage() string

func GetAgentVersion

func GetAgentVersion() string

func GetBaseURL

func GetBaseURL(controllerEndpoint string) (*url.URL, error)

func GetControllerEndpoint

func GetControllerEndpoint(host string) (endpoint string, err error)

func GetControllerImage

func GetControllerImage() string

func GetControllerVersion

func GetControllerVersion() string

func GetEntitlementDatasance added in v1.1.0

func GetEntitlementDatasance(activationCode string, seatID string, seatName string) (string, string, error)

func GetKubeletImage

func GetKubeletImage() string

func GetOperatorImage

func GetOperatorImage() string

func GetPortManagerImage

func GetPortManagerImage() string

func GetProxyARMImage

func GetProxyARMImage() string

func GetProxyImage

func GetProxyImage() string

func GetRouterARMImage

func GetRouterARMImage() string

func GetRouterImage

func GetRouterImage() string

func GetStaticFile

func GetStaticFile(filename string) (string, error)

func IsDebug

func IsDebug() bool

func IsLocalHost

func IsLocalHost(host string) bool

func IsLowerAlphanumeric

func IsLowerAlphanumeric(resourceType, name string) error

func IsNotFoundError

func IsNotFoundError(err error) bool

func IsSystemMsvc

func IsSystemMsvc(msvc *client.MicroserviceInfo) bool

func IsUnsupportedAPIError

func IsUnsupportedAPIError(err error) bool

func JoinAgentPath

func JoinAgentPath(elem ...string) string

func Log

func Log(callback func() error)

func NowRFC

func NowRFC() string

func NowUTC

func NowUTC() string

func Print

func Print(obj interface{}) error

func PrintError

func PrintError(message string)

Print 'message' with red color text

func PrintInfo

func PrintInfo(message string)

Print a 'message' with CSkyblue color text

func PrintNotify

func PrintNotify(message string)

Print 'message' with CDeepskyblue color text and background

func PrintSuccess

func PrintSuccess(message string)

Print 'message' with green color text

func RandomString

func RandomString(size int, chars string) string

func SSHVerbose

func SSHVerbose(msg string)

func SetDebug

func SetDebug(value bool)

func SpinEnable

func SpinEnable(isEnabled bool)

func SpinPause

func SpinPause() bool

func SpinStart

func SpinStart(msg string)

func SpinStop

func SpinStop()

func SpinUnpause

func SpinUnpause()

func UnmarshalYAML

func UnmarshalYAML(filename string, object interface{}) error

Types

type ActivationAttribute added in v1.1.0

type ActivationAttribute struct {
	Key   string `json:"key"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

type ActivationResponse added in v1.1.0

type ActivationResponse struct {
	AccessToken           string                `json:"accessToken"`
	ID                    string                `json:"id"`
	LeaseExpiry           string                `json:"leaseExpiry"`
	ProductID             string                `json:"productId"`
	EntitlementID         string                `json:"entitlementId"`
	EntitlementExpiryDate string                `json:"entitlementExpiryDate"`
	SeatID                string                `json:"seatId"`
	SeatName              string                `json:"seatName"`
	Activated             string                `json:"activated"`
	LastLease             string                `json:"lastLease"`
	Attributes            []ActivationAttribute `json:"attributes"`
	Features              []string              `json:"features"`
}

func ActivateLicense added in v1.1.0

func ActivateLicense(accessToken, nonce string) (*ActivationResponse, error)

type ConflictError

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

ConflictError export

func NewConflictError

func NewConflictError(message string) *ConflictError

NewConflictError export

func (*ConflictError) Error

func (err *ConflictError) Error() string

Error export

type EntitlementDuration added in v1.1.0

type EntitlementDuration struct {
	Type  string `json:"type"`
	Count int    `json:"count"`
}

type EntitlementPeriod added in v1.1.0

type EntitlementPeriod struct {
	Type  string `json:"type"`
	Count *int   `json:"count"`
}

type EntitlementPlan added in v1.1.0

type EntitlementPlan struct {
	Name             string              `json:"name"`
	LicenseType      string              `json:"licenseType"`
	LicenseStartType string              `json:"licenseStartType"`
	LicenseDuration  EntitlementDuration `json:"licenseDuration"`
}

type EntitlementResponse added in v1.1.0

type EntitlementResponse struct {
	CustomerName         string            `json:"customerName"`
	CustomerAccountRefID string            `json:"customerAccountRefId"`
	OrderRefID           string            `json:"orderRefId"`
	OfferingName         string            `json:"offeringName"`
	SKU                  string            `json:"sku"`
	ProductName          string            `json:"productName"`
	Plan                 EntitlementPlan   `json:"plan"`
	GracePeriod          EntitlementPeriod `json:"gracePeriod"`
	LingerPeriod         EntitlementPeriod `json:"lingerPeriod"`
	LeasePeriod          EntitlementPeriod `json:"leasePeriod"`
	OfflineLeasePeriod   EntitlementPeriod `json:"offlineLeasePeriod"`
}

type Error

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

func NewError

func NewError(message string) *Error

func (*Error) Error

func (err *Error) Error() string

type HTTPError

type HTTPError struct {
	Code int
	// contains filtered or unexported fields
}

HTTPError export

func NewHTTPError

func NewHTTPError(message string, code int) *HTTPError

NewHTTPError export

func (*HTTPError) Error

func (err *HTTPError) Error() string

Error export

type InputError

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

InputError export

func NewInputError

func NewInputError(message string) *InputError

NewInputError export

func (*InputError) Error

func (err *InputError) Error() string

Error export

type InternalError

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

InternalError export

func NewInternalError

func NewInternalError(message string) *InternalError

NewInternalError export

func (*InternalError) Error

func (err *InternalError) Error() string

Error export

type NotFoundError

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

NotFoundError export

func NewNotFoundError

func NewNotFoundError(message string) *NotFoundError

NewNotFoundError export

func (*NotFoundError) Error

func (err *NotFoundError) Error() string

Error export

type SecureShellClient

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

func NewSecureShellClient

func NewSecureShellClient(user, host, privKeyFilename string) (*SecureShellClient, error)

func (*SecureShellClient) Connect

func (cl *SecureShellClient) Connect() (err error)

func (*SecureShellClient) CopyFolderTo

func (cl *SecureShellClient) CopyFolderTo(srcPath, destPath, permissions string, recurse bool) error

func (*SecureShellClient) CopyTo

func (cl *SecureShellClient) CopyTo(reader io.Reader, destPath, destFilename, permissions string, size int64) error

func (*SecureShellClient) CreateFolder

func (cl *SecureShellClient) CreateFolder(path string) error

func (*SecureShellClient) Disconnect

func (cl *SecureShellClient) Disconnect() error

func (*SecureShellClient) Run

func (cl *SecureShellClient) Run(cmd string) (stdout bytes.Buffer, err error)

func (*SecureShellClient) RunUntil

func (cl *SecureShellClient) RunUntil(condition *regexp.Regexp, cmd string, ignoredErrors []string) (err error)

func (*SecureShellClient) SetPort

func (cl *SecureShellClient) SetPort(port int)

type UnmarshalError

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

func NewUnmarshalError

func NewUnmarshalError(message string) *UnmarshalError

func (*UnmarshalError) Error

func (err *UnmarshalError) Error() string

type UnsupportedAPIError

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

func NewUnsupportedAPIError

func NewUnsupportedAPIError(message string) *UnsupportedAPIError

func (*UnsupportedAPIError) Error

func (err *UnsupportedAPIError) Error() string

type Version

type Version struct {
	VersionNumber string `yaml:"version"`
	Platform      string
	Commit        string
	Date          string
}

func GetVersion

func GetVersion() Version

Jump to

Keyboard shortcuts

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