dashboard

package
v1.0.0-beta9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRoute

func InitRoute(r fiber.Router)

Types

type ConfigurationMap

type ConfigurationMap map[string]interface{}

func (*ConfigurationMap) Scan

func (sla *ConfigurationMap) Scan(value interface{}) error

func (ConfigurationMap) Value

func (sla ConfigurationMap) Value() (driver.Value, error)

type Dashboard

type Dashboard struct {
	Id      string `json:"id,omitempty" gorm:"primaryKey"`
	Name    string `json:"name"`
	Default bool   `json:"default"`
	UserId  string `gorm:"index" json:"-"`

	Widgets []Widget `json:"widgets" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type DashboardRepository

type DashboardRepository interface {
	GetAllDashboards(userId string) ([]Dashboard, *exception.AppError)
	GetDashboardById(userId string, id string) (Dashboard, *exception.AppError)
	GetDefaultDashboard(userId string) (Dashboard, *exception.AppError)
	CreateDashboard(d Dashboard) *exception.AppError
	UpdateDashboard(d Dashboard) *exception.AppError
	DeleteDashboard(id string, userId string) *exception.AppError
	SetDefaultDashboard(id string, userId string) *exception.AppError
	UpdateWidget(widget Widget) *exception.AppError
	DeleteWidget(id string, userId string) *exception.AppError
	CreateWidget(widget Widget) *exception.AppError
	GetWidgetsByDashboardId(dashboardId, userId string) ([]Widget, *exception.AppError)
	GetWidgetById(id, userId string) (Widget, *exception.AppError)
}

type DashboardRepositoryDB

type DashboardRepositoryDB struct {
	// contains filtered or unexported fields
}

func NewDashboardRepository

func NewDashboardRepository() DashboardRepositoryDB

func (DashboardRepositoryDB) CreateDashboard

func (d DashboardRepositoryDB) CreateDashboard(b Dashboard) *exception.AppError

func (DashboardRepositoryDB) CreateWidget

func (d DashboardRepositoryDB) CreateWidget(widget Widget) *exception.AppError

func (DashboardRepositoryDB) DeleteDashboard

func (d DashboardRepositoryDB) DeleteDashboard(id string, userId string) *exception.AppError

func (DashboardRepositoryDB) DeleteWidget

func (d DashboardRepositoryDB) DeleteWidget(id string, userId string) *exception.AppError

func (DashboardRepositoryDB) GetAllDashboards

func (d DashboardRepositoryDB) GetAllDashboards(userId string) ([]Dashboard, *exception.AppError)

func (DashboardRepositoryDB) GetDashboardById

func (d DashboardRepositoryDB) GetDashboardById(userId string, id string) (Dashboard, *exception.AppError)

func (DashboardRepositoryDB) GetDefaultDashboard

func (d DashboardRepositoryDB) GetDefaultDashboard(userId string) (Dashboard, *exception.AppError)

func (DashboardRepositoryDB) GetWidgetById

func (d DashboardRepositoryDB) GetWidgetById(id, userId string) (Widget, *exception.AppError)

func (DashboardRepositoryDB) GetWidgetsByDashboardId

func (d DashboardRepositoryDB) GetWidgetsByDashboardId(dashboardId, userId string) ([]Widget, *exception.AppError)

func (DashboardRepositoryDB) SetDefaultDashboard

func (d DashboardRepositoryDB) SetDefaultDashboard(id string, userId string) *exception.AppError

func (DashboardRepositoryDB) UpdateDashboard

func (d DashboardRepositoryDB) UpdateDashboard(b Dashboard) *exception.AppError

func (DashboardRepositoryDB) UpdateWidget

func (d DashboardRepositoryDB) UpdateWidget(widget Widget) *exception.AppError

type Widget

type Widget struct {
	Id   string `json:"id" gorm:"primaryKey"`
	Name string `json:"name"`
	X    int    `json:"x"`
	Y    int    `json:"y"`
	W    int    `json:"w"`
	H    int    `json:"h"`
	HTML string `gorm:"type:longtext" json:"html"`
	CSS  string `gorm:"type:longtext" json:"css"`
	JS   string `gorm:"type:longtext" json:"js"`

	DashboardId string `gorm:"index" json:"-"`
	UserId      string `gorm:"index" json:"-"`
}

Jump to

Keyboard shortcuts

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