Documentation ¶
Overview ¶
Package mysql handles data persistence for spaces.
Index ¶
- type Scope
- func (s Scope) Add(ctx domain.RequestContext, sp space.Space) (err error)
- func (s Scope) AddRole(ctx domain.RequestContext, r space.Role) (err error)
- func (s Scope) ChangeOwner(ctx domain.RequestContext, currentOwner, newOwner string) (err error)
- func (s Scope) Delete(ctx domain.RequestContext, id string) (rows int64, err error)
- func (s Scope) DeleteRole(ctx domain.RequestContext, roleID string) (rows int64, err error)
- func (s Scope) DeleteSpaceRoles(ctx domain.RequestContext, spaceID string) (rows int64, err error)
- func (s Scope) DeleteUserSpaceRoles(ctx domain.RequestContext, spaceID, userID string) (rows int64, err error)
- func (s Scope) Get(ctx domain.RequestContext, id string) (sp space.Space, err error)
- func (s Scope) GetAll(ctx domain.RequestContext) (sp []space.Space, err error)
- func (s Scope) GetRoles(ctx domain.RequestContext, labelID string) (r []space.Role, err error)
- func (s Scope) GetUserRoles(ctx domain.RequestContext) (r []space.Role, err error)
- func (s Scope) MoveSpaceRoles(ctx domain.RequestContext, previousLabel, newLabel string) (err error)
- func (s Scope) PublicSpaces(ctx domain.RequestContext, orgID string) (sp []space.Space, err error)
- func (s Scope) Update(ctx domain.RequestContext, sp space.Space) (err error)
- func (s Scope) Viewers(ctx domain.RequestContext) (v []space.Viewer, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scope ¶
Scope provides data access to MySQL.
func (Scope) ChangeOwner ¶
func (s Scope) ChangeOwner(ctx domain.RequestContext, currentOwner, newOwner string) (err error)
ChangeOwner transfer space ownership.
func (Scope) DeleteRole ¶
DeleteRole deletes the labelRoleID record from the labelrole table.
func (Scope) DeleteSpaceRoles ¶
DeleteSpaceRoles deletes records from the labelrole table which have the given space ID.
func (Scope) DeleteUserSpaceRoles ¶
func (s Scope) DeleteUserSpaceRoles(ctx domain.RequestContext, spaceID, userID string) (rows int64, err error)
DeleteUserSpaceRoles removes all roles for the specified user, for the specified space.
func (Scope) GetAll ¶
GetAll returns spaces that the user can see. Also handles which spaces can be seen by anonymous users.
func (Scope) GetRoles ¶
GetRoles returns a slice of labelrole records, for the given labelID in the client's organization, grouped by user.
func (Scope) GetUserRoles ¶
GetUserRoles returns a slice of role records, for both the client's user and organization, and those space roles that exist for all users in the client's organization.
func (Scope) MoveSpaceRoles ¶
func (s Scope) MoveSpaceRoles(ctx domain.RequestContext, previousLabel, newLabel string) (err error)
MoveSpaceRoles changes the space ID for space role records from previousLabel to newLabel.
func (Scope) PublicSpaces ¶
PublicSpaces returns spaces that anyone can see.