Documentation
¶
Index ¶
- func ResetSessionID(id ID)
- type ID
- func (t *ID) IsZero() bool
- func (t *ID) Load()
- func (t ID) MarshalJSON() ([]byte, error)
- func (t *ID) ParentVar() string
- func (t *ID) SetUUID(id uuid.UUID)
- func (t *ID) String() string
- func (t *ID) UUID() uuid.UUID
- func (t *ID) UnmarshalJSON(b []byte) error
- func (t *ID) Var() string
- func (t *ID) Zero()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
func NewOrchestrationID ¶
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 ¶
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 (ID) MarshalJSON ¶
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 ¶
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) UnmarshalJSON ¶
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 ¶
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.