Documentation
¶
Index ¶
- Constants
- Variables
- type DashboardInterface
- type Engine
- func (e *Engine) CreateDashboard(ctx context.Context, d *api.Dashboard) (*api.Dashboard, error)
- func (e *Engine) CreateDashboardTable(ctx context.Context, driver string) error
- func (e *Engine) DeleteDashboard(ctx context.Context, d *api.Dashboard) error
- func (e *Engine) GetDashboard(ctx context.Context, id string) (*api.Dashboard, error)
- func (e *Engine) UpdateDashboard(ctx context.Context, d *api.Dashboard) (*api.Dashboard, error)
- type EngineOpt
Constants ¶
const ( // CreatePostgresTable represents a query to create the Postgres dashboards table. CreatePostgresTable = `` /* 277-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite dashboards table. CreateSqliteTable = `` /* 228-byte string literal not displayed */ )
Variables ¶
var ( // ErrEmptyDashName defines the error type when a // User type has an empty Name field provided. ErrEmptyDashName = errors.New("empty dashboard name provided") // ErrExceededAdminLimit defines the error type when a // User type has Admins field provided that exceeds the database limit. ErrExceededAdminLimit = errors.New("exceeded admins limit") )
Functions ¶
This section is empty.
Types ¶
type DashboardInterface ¶
type DashboardInterface interface {
// CreateDashboardTable defines a function that creates the dashboards table.
CreateDashboardTable(context.Context, string) error
// CreateDashboard defines a function that creates a dashboard.
CreateDashboard(context.Context, *api.Dashboard) (*api.Dashboard, error)
// DeleteDashboard defines a function that deletes a dashboard.
DeleteDashboard(context.Context, *api.Dashboard) error
// GetDashboard defines a function that gets a dashboard by ID.
GetDashboard(context.Context, string) (*api.Dashboard, error)
// UpdateDashboard defines a function that updates a dashboard.
UpdateDashboard(context.Context, *api.Dashboard) (*api.Dashboard, error)
}
type Engine ¶ added in v0.27.0
type Engine struct {
// contains filtered or unexported fields
}
Engine represents the dashboard functionality that implements the DashboardService interface.
func (*Engine) CreateDashboard ¶ added in v0.27.0
CreateDashboard creates a new dashboard in the database.
func (*Engine) CreateDashboardTable ¶ added in v0.27.0
CreateDashboardTable creates the dashboards table in the database.
func (*Engine) DeleteDashboard ¶ added in v0.27.0
DeleteDashboard deletes an existing dashboard from the database.
func (*Engine) GetDashboard ¶ added in v0.27.0
GetDashboard gets a dashboard by UUID from the database.
type EngineOpt ¶
EngineOpt represents a configuration option to initialize the database engine for dashboards.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for dashboards.
func WithContext ¶
WithContext sets the context in the database engine for dashboards.
func WithDriver ¶
WithDriver sets the driver type in the database engine for dashboards.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for dashboards.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for dashboards.