Documentation
¶
Overview ¶
Package userinfo is how a library reads people's current email, name and username from the host's directory in process, importing neither the other. Values are current at read time; the reader keeps no copy and asks again when it needs them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lookup ¶
type Lookup interface {
// Get returns the users of ids, keyed by ID. An id the directory does not
// hold (never issued, malformed or deleted) is absent, not an error.
Get(ctx context.Context, ids []string) (map[string]User, error)
// Search returns the users whose email, username or name contains query,
// ignoring case: each once, as many as match up to limit. query is
// literal text, never a pattern. An empty query or a limit below 1
// returns none.
Search(ctx context.Context, query string, limit int) ([]User, error)
}
Lookup is the host's directory. It is safe for concurrent use. Each read returns the current values; a caller keeps no copy. An error means the directory could not answer and says nothing about any id.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package userinfotest checks a host's userinfo.Lookup in the host's own CI.
|
Package userinfotest checks a host's userinfo.Lookup in the host's own CI. |
Click to show internal directories.
Click to hide internal directories.