xsession

package
v3.0.0-rc49 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetSessionID

func ResetSessionID(id ID)

ResetSessionID is for go test

Types

type ID

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

func ExecID

func ExecID() *ID

ExecID returns the exec id of this process.

func NewExecID

func NewExecID(ids ...uuid.UUID) ID

NewExecID creates a new exec id. If no uuid is given, assign a random one.

func NewOrchestrationID

func NewOrchestrationID(id uuid.UUID) ID

NewOrchestrationID creates an orchestration id carrying the id it is given, and carrying none when that id is nil.

Unlike NewSessionID and NewExecID, a nil id is not answered with a fresh random one: an exec naming itself in its own logs wants an id whatever happens, where a caller reporting which orchestration something belongs to wants the truth, and a random one would report belonging to an orchestration that never existed.

func NewSessionID

func NewSessionID(ids ...uuid.UUID) ID

NewSessionID creates a new session id. If no uuid is given, assign a random one.

func OrchestrationID

func OrchestrationID() *ID

OrchestrationID returns the orchestration id this process is a step of, and a zero id when it is a step of none.

func SessionID

func SessionID() *ID

SessionID returns the session id of this process.

func (*ID) IsZero

func (t *ID) IsZero() bool

func (*ID) Load

func (t *ID) Load()

func (ID) MarshalJSON

func (t ID) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface. It marshals the id as a JSON string representation of the UUID. This method is also used by sigs.k8s.io/yaml for YAML marshaling.

func (*ID) ParentVar

func (t *ID) ParentVar() string

ParentVar returns the id as a OSVC_PARENT_SESSION_ID=<session id> environment variable setter string, and the empty string when there is no id to set. Used by the daemon to provide its session id to the executed crm commands.

func (*ID) SetUUID

func (t *ID) SetUUID(id uuid.UUID)

func (*ID) String

func (t *ID) String() string

String returns the string representation of the id.

func (*ID) UUID

func (t *ID) UUID() uuid.UUID

UUID returns the underlying uuid.UUID value.

func (*ID) UnmarshalJSON

func (t *ID) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler interface. It unmarshals a JSON string into an id. This method is also used by sigs.k8s.io/yaml for YAML unmarshaling.

func (*ID) Var

func (t *ID) Var() string

Var returns the id as a OSVC_SESSION_ID=<session id> environment variable setter string, and the empty string when there is no id to set, so a caller exporting an orchestration id it may not have can hand what it gets to the environment without naming an orchestration that never existed.

func (*ID) Zero

func (t *ID) Zero()

Jump to

Keyboard shortcuts

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