diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-04-17 14:32:45 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-15 19:09:20 -0400 |
commit | 07af5f9aa8e4786d374c8099de7e972e56e545a1 (patch) | |
tree | 42c5cc1ebb0a60bd4c4149025a415cd8a482dce4 /sd_login/doc.go | |
parent | 0daddb9b0b115ed01c07e09502d45a23d0532bac (diff) |
sd_login: add a diagram, and a mention of Monitor to the package docs
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 |