users: Index | Files | Directories

package users

import ""

Package users provides a users service definition.


Package Files


type EditRequest Uses

type EditRequest struct {

EditRequest represents a request to edit a user.

type Service Uses

type Service interface {
    // Get fetches the specified user.
    Get(ctx context.Context, user UserSpec) (User, error)

    // GetAuthenticatedSpec fetches the currently authenticated
    // user specification, or UserSpec{ID: 0} if there is no
    // authenticated user. A non-nil error is returned if the
    // the authentication process was not able to successfully
    // determine if a user or no user is currently authenticated.
    GetAuthenticatedSpec(ctx context.Context) (UserSpec, error)

    // GetAuthenticated fetches the currently authenticated user,
    // or User{UserSpec: UserSpec{ID: 0}} if there is no authenticated user.
    GetAuthenticated(ctx context.Context) (User, error)

    // Edit the authenticated user.
    Edit(ctx context.Context, er EditRequest) (User, error)

Service for users.

type Store Uses

type Store interface {
    // Create creates the specified user.
    // It returns os.ErrExist if the user already exists.
    Create(ctx context.Context, user User) error

    // Get fetches the specified user.
    Get(ctx context.Context, user UserSpec) (User, error)

Store for users.

type User Uses

type User struct {
    Elsewhere []UserSpec // THINK: Consider merging Elsewhere with root-most UserSpec. Maybe even use a set, order of linked accounts shouldn't matter, should it?

    Login     string
    Name      string
    Email     string // Public email.
    AvatarURL string
    HTMLURL   string

    SiteAdmin bool

User represents a user.

type UserSpec Uses

type UserSpec struct {
    ID     uint64
    Domain string

UserSpec specifies a user. ID value 0 represents no user. Valid users may not use 0 as their ID.


asanaapiPackage asanaapi implements users.Service using Asana API client.
fsPackage fs implements an in-memory users.Store backed by a virtual filesystem.
githubapiPackage githubapi implements users.Service using GitHub API client.

Package users imports 1 packages (graph) and is imported by 53 packages. Updated 2018-01-27. Refresh now. Tools for package owners.