c8ysession

package
v2.44.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearEnvironmentVariables added in v2.42.0

func ClearEnvironmentVariables(shell utilities.ShellType)

func ClearProcessEnvironment added in v2.42.0

func ClearProcessEnvironment()

func FormatHost

func FormatHost(host string) string

func GetSessionEnvKeys added in v2.42.0

func GetSessionEnvKeys() []string

func GetVariablesFromSession added in v2.42.0

func GetVariablesFromSession(session *CumulocitySession, client *c8y.Client, setPassword bool) map[string]interface{}

GetVariablesFromSession gets all the environment variables associated with the current session

func IsSessionFilePath added in v2.42.1

func IsSessionFilePath(path string) bool

func PrintSessionInfo

func PrintSessionInfo(w io.Writer, client *c8y.Client, cfg *config.Config, session CumulocitySession)

PrintSessionInfo print out the session information to writer (i.e. console or file)

func PrintSessionInfoAsJSON added in v2.42.0

func PrintSessionInfoAsJSON(w io.Writer, client *c8y.Client, cfg *config.Config, session CumulocitySession) error

func ShowClientEnvironmentVariables added in v2.42.0

func ShowClientEnvironmentVariables(cfg *config.Config, c8yclient *c8y.Client, shell utilities.ShellType)

func ShowSessionEnvironmentVariables added in v2.42.0

func ShowSessionEnvironmentVariables(session *CumulocitySession, cfg *config.Config, c8yclient *c8y.Client, shell utilities.ShellType)

func WriteOutput added in v2.42.0

func WriteOutput(w io.Writer, client *c8y.Client, cfg *config.Config, session *CumulocitySession, format string) error

Types

type CumulocitySession

type CumulocitySession struct {
	Schema string `json:"$schema,omitempty"`

	// ID          string `json:"id"`
	Host            string `json:"host"`
	Tenant          string `json:"tenant"`
	Version         string `json:"version"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	TOTP            string `json:"totp"`
	Token           string `json:"token"`
	Description     string `json:"description"`
	UseTenantPrefix bool   `json:"useTenantPrefix"`

	Settings *config.CommandSettings `json:"settings,omitempty"`

	MicroserviceAliases map[string]string `json:"microserviceAliases,omitempty"`

	Index     int    `json:"-"`
	Path      string `json:"-"`
	Extension string `json:"-"`
	Name      string `json:"-"`

	// How to identify the session
	SessionUri string `json:"sessionUri"`

	Logger *logger.Logger `json:"-"`
	Config *config.Config `json:"-"`
}

CumulocitySession contains all settings required to communicate with a Cumulocity service

func (CumulocitySession) GetDomain added in v2.42.0

func (s CumulocitySession) GetDomain() string

GetDomain gets the custom Cumulocity domain for cases where it differs from the Host

func (CumulocitySession) GetHost

func (s CumulocitySession) GetHost() string

func (CumulocitySession) GetPassword

func (s CumulocitySession) GetPassword() string

func (CumulocitySession) GetSessionPassphrase

func (s CumulocitySession) GetSessionPassphrase() string

func (*CumulocitySession) SetHost

func (s *CumulocitySession) SetHost(host string)

func (*CumulocitySession) SetPassword

func (s *CumulocitySession) SetPassword(password string)

func (*CumulocitySession) SetToken

func (s *CumulocitySession) SetToken(token string)

type CumulocitySessions

type CumulocitySessions struct {
	Sessions []CumulocitySession `json:"sessions"`
}

Jump to

Keyboard shortcuts

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