users

package
v0.0.0-...-8a4eff6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToContext

func AddToContext(ctx context.Context, user User) context.Context

Types

type Authenticator

type Authenticator struct {
	// contains filtered or unexported fields
}

func NewAuthenticator

func NewAuthenticator(c *auth.Client) *Authenticator

func (*Authenticator) Admin

func (*Authenticator) Authenticated

func (a *Authenticator) Authenticated(next endpoint.Endpoint) endpoint.Endpoint

func (*Authenticator) Valid

type User

type User struct {
	ID      int
	IsAdmin bool

	Owns      []int
	CanSee    []int
	CanEdit   []int
	Bookmarks []int
}

func FromContext

func FromContext(ctx context.Context) (User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL