Documentation ¶
Index ¶
- Variables
- type CreateUserParams
- type CredentialsParam
- type Scope
- type Service
- func (s Service) Authenticate(creds CredentialsParam) (*Token, error)
- func (s Service) CreateUser(params CreateUserParams) (*User, error)
- func (s Service) DeleteUser(userId int64) error
- func (s Service) Get(id int64) (*User, error)
- func (s Service) GetUserForToken(plainText string, scope Scope) (*User, error)
- type Storer
- type Token
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateUser = errors.New("user already exists") ErrNotFound = errors.New("user not found") ErrInvalidToken = errors.New("token is invalid or expired") ErrInvalidCredentials = errors.New("invalid credentails") )
View Source
var (
AnonymousUser = &User{}
)
Functions ¶
This section is empty.
Types ¶
type CreateUserParams ¶
type CredentialsParam ¶
type Scope ¶
type Scope string
const ( // We could add diferent scopes, like password-reset, etc. ScopeAuthentication Scope = "authentication" )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (Service) Authenticate ¶
func (s Service) Authenticate(creds CredentialsParam) (*Token, error)
func (Service) CreateUser ¶
func (s Service) CreateUser(params CreateUserParams) (*User, error)
func (Service) DeleteUser ¶
Click to show internal directories.
Click to hide internal directories.