Documentation
¶
Index ¶
- func SetLogger(l Logger)
- func ValidateStatement(st *keys.Statement) error
- type ContextLogger
- type LogLevel
- type Logger
- type Option
- type Options
- type SearchRequest
- type SearchResult
- type Users
- func (u *Users) CheckForExisting(ctx context.Context, sc *keys.Sigchain) (keys.ID, error)
- func (u *Users) CheckSigchain(ctx context.Context, sc *keys.Sigchain) (*user.Result, error)
- func (u *Users) Expired(ctx context.Context, dt time.Duration, maxAge time.Duration) ([]keys.ID, error)
- func (u *Users) Find(ctx context.Context, kid keys.ID) (*user.Result, error)
- func (u *Users) Get(ctx context.Context, kid keys.ID) (*user.Result, error)
- func (u *Users) KIDs(ctx context.Context) ([]keys.ID, error)
- func (u *Users) RequestVerify(ctx context.Context, usr *user.User) *user.Result
- func (u *Users) Requestor() request.Requestor
- func (u *Users) Search(ctx context.Context, req *SearchRequest) ([]*SearchResult, error)
- func (u *Users) Status(ctx context.Context, st user.Status) ([]keys.ID, error)
- func (u *Users) Update(ctx context.Context, kid keys.ID) (*user.Result, error)
- func (u *Users) User(ctx context.Context, user string) (*user.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateStatement ¶
ValidateStatement returns error if statement is not a valid user statement.
Types ¶
type ContextLogger ¶
type ContextLogger interface {
Debugf(ctx context.Context, format string, args ...interface{})
Infof(ctx context.Context, format string, args ...interface{})
Warningf(ctx context.Context, format string, args ...interface{})
Errorf(ctx context.Context, format string, args ...interface{})
}
ContextLogger interface used in this package with request context.
type Logger ¶
type Logger interface {
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warningf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
}
Logger interface used in this package.
type SearchRequest ¶
type SearchRequest struct {
// Query to search for.
Query string
// Limit number of results.
Limit int
}
SearchRequest ...
type SearchResult ¶
type SearchResult struct {
KID keys.ID
Result *user.Result
// Field we matched on (if not the user).
Field string
}
SearchResult ...
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users keeps track of sigchain user links.
func (*Users) CheckForExisting ¶
CheckForExisting returns key ID of exsiting user in sigchain different from this sigchain key.
func (*Users) CheckSigchain ¶
CheckSigchain looks for user in a Sigchain and creates a result or updates the current result.
func (*Users) Expired ¶
func (u *Users) Expired(ctx context.Context, dt time.Duration, maxAge time.Duration) ([]keys.ID, error)
Expired returns KIDs that haven't been checked in a duration.
func (*Users) Get ¶
Get user result for KID. Retrieves cached result. If Update(kid) has not been called or there is no user statement, this will return nil.
func (*Users) RequestVerify ¶
RequestVerify requests and verifies a user. Doesn't index result.
func (*Users) Search ¶
func (u *Users) Search(ctx context.Context, req *SearchRequest) ([]*SearchResult, error)
Search for users.