userpreferences

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Get(c *gin.Context)
	Update(c *gin.Context)
}

func NewApi

func NewApi(
	store Store,
	widgetStore widget.Store,
	enforcer security.Enforcer,
	actionLogger logger.ActionLogger,
) API

type EditRequest

type EditRequest struct {
	Widget  string                 `json:"widget" binding:"required"`
	Content map[string]interface{} `json:"content" binding:"required"`
}

type Response

type Response struct {
	Widget  string                 `bson:"widget" json:"widget"`
	Content map[string]interface{} `bson:"content" json:"content"`

	Filters []widgetfilter.Response `bson:"filters" json:"filters"`
}

type Store

type Store interface {
	Find(ctx context.Context, userId, widgetId string) (*Response, error)
	Update(ctx context.Context, userId string, request EditRequest) (*Response, bool, error)
}

func NewStore

func NewStore(
	dbClient mongo.DbClient,
	authorProvider author.Provider,
) Store

Jump to

Keyboard shortcuts

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