dashboard

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CreatePostgresTable represents a query to create the Postgres dashboards table.
	CreatePostgresTable = `` /* 279-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

func New

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

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

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)
}

DashboardInterface represents the Vela interface for repo functions with the supported Database backends.

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