dashboard

package
v1.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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" gorm:"primary_key"`
	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)
}

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) 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:"primary_key"`
	Name          string           `json:"name"`
	X             int              `json:"x"`
	Y             int              `json:"y"`
	W             int              `json:"w"`
	H             int              `json:"h"`
	Configuration ConfigurationMap `gorm:"type:longtext" json:"configuration"`
	HTML          string           `gorm:"type:longtext" json:"html"`
	CSS           string           `gorm:"type:longtext" json:"css"`

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

type WidgetType

type WidgetType struct {
	Name string `yaml:"name"`
	Size struct {
		W int `yaml:"w"`
		H int `yaml:"h"`
	} `yaml:"size"`
	HTML          string           `yaml:"html,omitempty"`
	CSS           string           `yaml:"css,omitempty"`
	Configuration ConfigurationMap `yaml:"configuration,omitempty"`
}

Jump to

Keyboard shortcuts

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