mysql

package
v1.53.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2017 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mysql handles data persistence for spaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scope

type Scope struct {
	Runtime *env.Runtime
}

Scope provides data access to MySQL.

func (Scope) Add

func (s Scope) Add(ctx domain.RequestContext, sp space.Space) (err error)

Add adds new folder into the store.

func (Scope) AddRole

func (s Scope) AddRole(ctx domain.RequestContext, r space.Role) (err error)

AddRole inserts the given record into the labelrole database table.

func (Scope) ChangeOwner

func (s Scope) ChangeOwner(ctx domain.RequestContext, currentOwner, newOwner string) (err error)

ChangeOwner transfer space ownership.

func (Scope) Delete

func (s Scope) Delete(ctx domain.RequestContext, id string) (rows int64, err error)

Delete removes space from the store.

func (Scope) DeleteRole

func (s Scope) DeleteRole(ctx domain.RequestContext, roleID string) (rows int64, err error)

DeleteRole deletes the labelRoleID record from the labelrole table.

func (Scope) DeleteSpaceRoles

func (s Scope) DeleteSpaceRoles(ctx domain.RequestContext, spaceID string) (rows int64, err error)

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) Get

func (s Scope) Get(ctx domain.RequestContext, id string) (sp space.Space, err error)

Get returns a space from the store.

func (Scope) GetAll

func (s Scope) GetAll(ctx domain.RequestContext) (sp []space.Space, err error)

GetAll returns spaces that the user can see. Also handles which spaces can be seen by anonymous users.

func (Scope) GetRoles

func (s Scope) GetRoles(ctx domain.RequestContext, labelID string) (r []space.Role, err error)

GetRoles returns a slice of labelrole records, for the given labelID in the client's organization, grouped by user.

func (Scope) GetUserRoles

func (s Scope) GetUserRoles(ctx domain.RequestContext) (r []space.Role, err error)

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

func (s Scope) PublicSpaces(ctx domain.RequestContext, orgID string) (sp []space.Space, err error)

PublicSpaces returns spaces that anyone can see.

func (Scope) Update

func (s Scope) Update(ctx domain.RequestContext, sp space.Space) (err error)

Update saves space changes.

func (Scope) Viewers

func (s Scope) Viewers(ctx domain.RequestContext) (v []space.Viewer, err error)

Viewers returns the list of people who can see shared spaces.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL