Documentation ¶
Index ¶
- Variables
- func Init(p InitParams) (*User, *Team, error)
- type Auth
- type Builder
- func (b *Builder) Auths(auths []Auth) *Builder
- func (b *Builder) Build() (*User, error)
- func (b *Builder) Email(email string) *Builder
- func (b *Builder) ID(id id.UserID) *Builder
- func (b *Builder) Lang(lang language.Tag) *Builder
- func (b *Builder) LangFrom(lang string) *Builder
- func (b *Builder) MustBuild() *User
- func (b *Builder) Name(name string) *Builder
- func (b *Builder) NewID() *Builder
- func (b *Builder) Team(team id.TeamID) *Builder
- func (b *Builder) Theme(t Theme) *Builder
- type InitParams
- type Members
- func (m *Members) ContainsUser(u id.UserID) bool
- func (m *Members) Count() int
- func (m *Members) GetRole(u id.UserID) Role
- func (m *Members) IsOnlyOwner(u id.UserID) bool
- func (m *Members) Join(u id.UserID, role Role) error
- func (m *Members) Leave(u id.UserID) error
- func (m *Members) Members() map[id.UserID]Role
- func (m *Members) UpdateRole(u id.UserID, role Role) error
- func (m *Members) UsersByRole(role Role) []id.UserID
- type Role
- type Team
- type TeamBuilder
- func (b *TeamBuilder) Build() (*Team, error)
- func (b *TeamBuilder) ID(id id.TeamID) *TeamBuilder
- func (b *TeamBuilder) Members(members map[id.UserID]Role) *TeamBuilder
- func (b *TeamBuilder) MustBuild() *Team
- func (b *TeamBuilder) Name(name string) *TeamBuilder
- func (b *TeamBuilder) NewID() *TeamBuilder
- func (b *TeamBuilder) Personal(p bool) *TeamBuilder
- type Theme
- type User
- func (u *User) AddAuth(a Auth) bool
- func (u *User) Auths() []Auth
- func (u *User) ClearAuths()
- func (u *User) ContainAuth(a Auth) bool
- func (u *User) Email() string
- func (u *User) ID() id.UserID
- func (u *User) Lang() language.Tag
- func (u *User) Name() string
- func (u *User) RemoveAuth(a Auth) bool
- func (u *User) RemoveAuthByProvider(provider string) bool
- func (u *User) Team() id.TeamID
- func (u *User) Theme() Theme
- func (u *User) UpdateEmail(email string)
- func (u *User) UpdateLang(lang language.Tag)
- func (u *User) UpdateName(name string)
- func (u *User) UpdateTeam(team id.TeamID)
- func (u *User) UpdateTheme(t Theme)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserAlreadyJoined = errors.New("user already joined") ErrCannotModifyPersonalTeam = errors.New("personal team cannot be modified") ErrTeamWithProjects = errors.New("target team still has some project") ErrTargetUserNotInTheTeam = errors.New("target user does not exist in the team") )
View Source
var ( // RoleReader is a role who can read project RoleReader = Role("reader") // RoleWriter is a role who can read and write project RoleWriter = Role("writer") // RoleOwner is a role who can have full controll of project RoleOwner = Role("owner") // ErrInvalidRole _ ErrInvalidRole = errors.New("invalid role") )
Functions ¶
Types ¶
type Auth ¶
func AuthFromAuth0Sub ¶
type InitParams ¶
type Members ¶
type Members struct {
// contains filtered or unexported fields
}
func CopyMembers ¶
func NewFixedMembers ¶
func NewMembers ¶
func NewMembers() *Members
type Team ¶
type Team struct {
// contains filtered or unexported fields
}
func (*Team) IsPersonal ¶
type TeamBuilder ¶
type TeamBuilder struct {
// contains filtered or unexported fields
}
TeamBuilder _
func (*TeamBuilder) Members ¶
func (b *TeamBuilder) Members(members map[id.UserID]Role) *TeamBuilder
Members _
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) ClearAuths ¶
func (u *User) ClearAuths()
func (*User) ContainAuth ¶
func (*User) RemoveAuth ¶
func (*User) RemoveAuthByProvider ¶
func (*User) UpdateEmail ¶
func (*User) UpdateLang ¶
func (*User) UpdateName ¶
func (*User) UpdateTeam ¶
func (*User) UpdateTheme ¶
Click to show internal directories.
Click to hide internal directories.