settings

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CreatePostgresTable represents a query to create the Postgres settings table.
	CreatePostgresTable = `` /* 271-byte string literal not displayed */

	// CreateSqliteTable represents a query to create the Sqlite settings table.
	CreateSqliteTable = `` /* 327-byte string literal not displayed */

)
View Source
const (
	TableSettings = "settings"
)

Variables

This section is empty.

Functions

func New

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

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

Types

type EngineOpt

type EngineOpt func(*engine) error

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

func WithClient

func WithClient(client *gorm.DB) EngineOpt

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

func WithContext

func WithContext(ctx context.Context) EngineOpt

WithContext sets the context in the database engine for Settings.

func WithLogger

func WithLogger(logger *logrus.Entry) EngineOpt

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

func WithSkipCreation

func WithSkipCreation(skipCreation bool) EngineOpt

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

type SettingsInterface

type SettingsInterface interface {
	// CreateSettings defines a function that creates a platform settings record.
	CreateSettings(context.Context, *settings.Platform) (*settings.Platform, error)
	// GetSettings defines a function that gets platform settings.
	GetSettings(context.Context) (*settings.Platform, error)
	// UpdateSettings defines a function that updates platform settings.
	UpdateSettings(context.Context, *settings.Platform) (*settings.Platform, error)
}

SettingsInterface represents the Vela interface for settings functions with the supported Database backends.

Jump to

Keyboard shortcuts

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