Documentation ¶
Index ¶
- Variables
- func ChangeQuota(user *User, limit int) error
- func CheckUserAccess(teamNames []string, u *User) bool
- func CreateTeam(name string, user ...*User) error
- func GetTeamsNames(teams []Team) []string
- func ParseToken(header string) (string, error)
- func RegisterScheme(name string, scheme Scheme)
- func ReleaseApp(user *User) error
- func ReserveApp(user *User) error
- func UnregisterScheme(name string)
- type AuthenticationFailure
- type Key
- type ManagedScheme
- type Scheme
- type SchemeInfo
- type Team
- type Token
- type User
- func (u *User) AddKey(key Key) error
- func (u *User) AllowedApps() ([]string, error)
- func (u *User) Create() error
- func (u *User) CreateOnGandalf() error
- func (u *User) Delete() error
- func (u *User) FindKey(key Key) (Key, int)
- func (u *User) HasKey(key Key) bool
- func (u *User) IsAdmin() bool
- func (u *User) ListKeys() (map[string]string, error)
- func (u *User) RemoveKey(key Key) error
- func (u *User) Teams() ([]Team, error)
- func (u *User) Update() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidTeamName = errors.New("invalid team name") ErrTeamAlreadyExists = errors.New("team already exists") ErrTeamNotFound = errors.New("team not found") )
View Source
var ( ErrUserNotFound = stderrors.New("user not found") ErrUserAlreadyHasKey = stderrors.New("user already has this key") ErrKeyNotFound = stderrors.New("key not found") )
View Source
var ErrInvalidToken = errors.New("Invalid token")
Functions ¶
func ChangeQuota ¶
ChangeQuota redefines the limit of the user. The new limit must be bigger than or equal to the current number of apps of the user. The new limit maybe smaller than 0, which mean that the user should have an unlimited number of apps.
func CheckUserAccess ¶
func CreateTeam ¶
func GetTeamsNames ¶
func ParseToken ¶
ParseToken extracts token from a header: 'type token' or 'token'
func RegisterScheme ¶
func ReleaseApp ¶
ReleaseApp releases an app from the user list, releasing the quota spot for another app.
func ReserveApp ¶
ReserveApp reserves an app for the user, reserving it in the database. It's used to reserve the app in the user quota, returning an error when there isn't any space available.
func UnregisterScheme ¶
func UnregisterScheme(name string)
Types ¶
type AuthenticationFailure ¶
type AuthenticationFailure struct {
Message string
}
func (AuthenticationFailure) Error ¶
func (a AuthenticationFailure) Error() string
type ManagedScheme ¶
type Scheme ¶
type SchemeInfo ¶
type SchemeInfo map[string]interface{}
type User ¶
func GetUserByEmail ¶
func (*User) AllowedApps ¶
func (*User) CreateOnGandalf ¶
Click to show internal directories.
Click to hide internal directories.