Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFilters ¶
AddFilters adds Interface filters to the context.
Types ¶
type Filter ¶
Filter is the function signature for a filter user implementation. It gets the current user implementation, and returns a new user implementation backed by the one passed in.
type Interface ¶
type Interface interface { Current() *User CurrentOAuth(scopes ...string) (*User, error) IsAdmin() bool LoginURL(dest string) (string, error) LoginURLFederated(dest, identity string) (string, error) LogoutURL(dest string) (string, error) OAuthConsumerKey() (string, error) // If this implementation supports it, this will return an instance of the // Testable object for this service, which will let you 'log in' virtual users // in your test cases. If the implementation doesn't support it, it will // return nil. Testable() Testable }
Interface provides access to the "appengine/users" API methods.
type Testable ¶
type Testable interface { // SetUser sets the user to a pre-populated User object. SetUser(*User) // Login will generate and set a new User object with values derived from // email clientID, and admin values. If clientID is provided, the User will // look like they logged in with OAuth. If it's empty, then this will look // like they logged in via the cookie auth method. Login(email, clientID string, admin bool) // Equivalent to SetUser(nil), but a bit more obvious to read in the code :). Logout() }
Testable is the interface that test implimentations will provide.
type User ¶
type User struct { Email string AuthDomain string Admin bool ID string ClientID string FederatedIdentity string FederatedProvider string }
User is a mimic of https://godoc.org/google.golang.org/appengine/user#User
It's provided here for convenience, and is compile-time checked to be identical.
Click to show internal directories.
Click to hide internal directories.