dashboard

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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 New

func New(opts ...EngineOpt) (*Engine, error)

New creates and returns a Vela service for integrating with dashboards in the database.

func (*Engine) CreateDashboard added in v0.27.0

func (e *Engine) CreateDashboard(ctx context.Context, d *api.Dashboard) (*api.Dashboard, error)

CreateDashboard creates a new dashboard in the database.

func (*Engine) CreateDashboardTable added in v0.27.0

func (e *Engine) CreateDashboardTable(ctx context.Context, driver string) error

CreateDashboardTable creates the dashboards table in the database.

func (*Engine) DeleteDashboard added in v0.27.0

func (e *Engine) DeleteDashboard(ctx context.Context, d *api.Dashboard) error

DeleteDashboard deletes an existing dashboard from the database.

func (*Engine) GetDashboard added in v0.27.0

func (e *Engine) GetDashboard(ctx context.Context, id string) (*api.Dashboard, error)

GetDashboard gets a dashboard by UUID from the database.

func (*Engine) UpdateDashboard added in v0.27.0

func (e *Engine) UpdateDashboard(ctx context.Context, d *api.Dashboard) (*api.Dashboard, error)

UpdateDashboard updates an existing dashboard in the database.

type EngineOpt

type EngineOpt func(*Engine) error

EngineOpt represents a configuration option to initialize the database engine for dashboards.

func WithClient

func WithClient(client *gorm.DB) EngineOpt

WithClient sets the gorm.io/gorm client in the database engine for dashboards.

func WithContext

func WithContext(ctx context.Context) EngineOpt

WithContext sets the context in the database engine for dashboards.

func WithDriver

func WithDriver(driver string) EngineOpt

WithDriver sets the driver type in the database engine for dashboards.

func WithLogger

func WithLogger(logger *logrus.Entry) EngineOpt

WithLogger sets the github.com/sirupsen/logrus logger in the database engine for dashboards.

func WithSkipCreation

func WithSkipCreation(skipCreation bool) EngineOpt

WithSkipCreation sets the skip creation logic in the database engine for dashboards.

Jump to

Keyboard shortcuts

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