community: github.com/documize/community/domain/block Index | Files

package block

import "github.com/documize/community/domain/block"

Index

Package Files

endpoint.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) Add Uses

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

Add inserts new reusable content block into database.

func (*Handler) Delete Uses

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

Delete removes requested reusable content block.

func (*Handler) Get Uses

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

Get returns requested reusable content block.

func (*Handler) GetBySpace Uses

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

GetBySpace returns available reusable content blocks for the space.

func (*Handler) Update Uses

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

Update inserts new reusable content block into database.

type Store Uses

type Store struct {
    store.Context
    store.BlockStorer
}

Store provides data access to section template information.

func (Store) Add Uses

func (s Store) Add(ctx domain.RequestContext, b block.Block) (err error)

Add saves reusable content block.

func (Store) DecrementUsage Uses

func (s Store) DecrementUsage(ctx domain.RequestContext, id string) (err error)

DecrementUsage decrements usage counter for content block.

func (Store) Delete Uses

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

Delete removes reusable content block from database.

func (Store) Get Uses

func (s Store) Get(ctx domain.RequestContext, id string) (b block.Block, err error)

Get returns requested reusable content block.

func (Store) GetBySpace Uses

func (s Store) GetBySpace(ctx domain.RequestContext, spaceID string) (b []block.Block, err error)

GetBySpace returns all reusable content scoped to given space.

func (Store) IncrementUsage Uses

func (s Store) IncrementUsage(ctx domain.RequestContext, id string) (err error)

IncrementUsage increments usage counter for content block.

func (Store) RemoveReference Uses

func (s Store) RemoveReference(ctx domain.RequestContext, id string) (err error)

RemoveReference clears page.blockid for given blockID.

func (Store) Update Uses

func (s Store) Update(ctx domain.RequestContext, b block.Block) (err error)

Update updates existing reusable content block item.

Package block imports 16 packages (graph) and is imported by 2 packages. Updated 2019-07-31. Refresh now. Tools for package owners.