community: Index | Files

package space

import ""

Package space handles API calls and persistence for spaces. Spaces in Documize contain documents.


Package Files

endpoint.go space.go store.go

type Handler Uses

type Handler struct {
    Runtime *env.Runtime
    Store   *store.Store

Handler contains the runtime information such as logging and database.

func (*Handler) AcceptInvitation Uses

func (h *Handler) AcceptInvitation(w http.ResponseWriter, r *http.Request)

AcceptInvitation records the fact that a user has completed space onboard process.

func (*Handler) Add Uses

func (h *Handler) Add(w http.ResponseWriter, r *http.Request)

Add creates a new space.

func (*Handler) Delete Uses

func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)

Delete removes space.

func (*Handler) Get Uses

func (h *Handler) Get(w http.ResponseWriter, r *http.Request)

Get returns the requested space.

func (*Handler) GetViewable Uses

func (h *Handler) GetViewable(w http.ResponseWriter, r *http.Request)

GetViewable returns spaces the user can see.

func (*Handler) Invite Uses

func (h *Handler) Invite(w http.ResponseWriter, r *http.Request)

Invite sends users space invitation emails.

func (*Handler) Manage Uses

func (h *Handler) Manage(w http.ResponseWriter, r *http.Request)

Manage returns all shared spaces and orphaned spaces that have no owner.

func (*Handler) ManageOwner Uses

func (h *Handler) ManageOwner(w http.ResponseWriter, r *http.Request)

ManageOwner adds current user as space owner. Requires admin rights.

func (*Handler) Remove Uses

func (h *Handler) Remove(w http.ResponseWriter, r *http.Request)

Remove moves documents to another space before deleting it

func (*Handler) Update Uses

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

Update processes request to save space object to the database

type Store Uses

type Store struct {

Store provides data access to space information.

func (Store) Add Uses

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

Add adds new space into the store.

func (Store) AdminList Uses

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

AdminList returns all shared spaces and orphaned spaces that have no owner.

func (Store) Delete Uses

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

Delete removes space from the store.

func (Store) Get Uses

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

Get returns a space from the store.

func (Store) GetViewable Uses

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

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

func (Store) PublicSpaces Uses

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

PublicSpaces returns spaces that anyone can see.

func (Store) SetStats Uses

func (s Store) SetStats(ctx domain.RequestContext, spaceID string) (err error)

SetStats updates the number of category/documents in space.

func (Store) Update Uses

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

Update saves space changes.

Package space imports 31 packages (graph) and is imported by 4 packages. Updated 2020-02-07. Refresh now. Tools for package owners.