diff options
Diffstat (limited to 'sd_login/doc.go')
-rw-r--r-- | sd_login/doc.go | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/sd_login/doc.go b/sd_login/doc.go index 7bef4fe..2e083ad 100644 --- a/sd_login/doc.go +++ b/sd_login/doc.go @@ -42,4 +42,59 @@ // user if it is not part of a session. This "belonging" is // separate accounting by the cgroup manager; it is NOT the same // as the EUID/RUID. +// +// How these relations look in the types implemented here: +// +// ............................................ +// . . +// . +-------------+ . +// . | MachineName | . +// . +-------------+ . +// . ^ . +// . | . +// . |GetMachine() . +// . | . +// . ^ . +// . +-----------+ . +// . | ProcessID | . +// . +-----------+ . +// . v v . +// . | | . +// . GetSession() | | GetOwner() . +// . ,--------' '-------, . +// . | | . +// . v v . +// . +-------------+ GetUser() +--------+ . +// . | SessionName |>--------->| UserID | . +// . +-------------+ +--------+ . +// . v^^ ^ GetSessions() v . +// . ||| `---------------' . +// . ||| . +// . GetSeat()||GetSessions() . +// . |||GetActive() . +// . v^^ . +// . +----------+ . +// . | SeatName | . +// . +----------+ . +// . . +// ............................................ +// +// Missing from the above diagram: +// +// - As an optimization, SeatName.GetSessions() and .GetActive() +// return both the session name, and the user ID that owns the +// session. This is equivalent to just calling .GetUser() on the +// returned session. +// +// - There is also a UserID.GetSeats() that is equivalent to calling +// UserID.GetSessions(), and calling .GetSeat() on each returned +// session. +// +// TODO: Better describe how machines fit in; the high-level +// description doesn't really match the interface exposed (as evident +// by a glance at the diagram). +// +// Finally, if you would like to perform some action whenever a +// machine, seat, session, or logged-in-user is added or removed, +// there is a Monitor that will help you avoid polling. package sd_login |