Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CreatePostgresTable represents a query to create the Postgres workers table. CreatePostgresTable = `` /* 491-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite workers table. CreateSqliteTable = `` /* 481-byte string literal not displayed */ )
View Source
const ( // CreateHostnameAddressIndex represents a query to create an // index on the workers table for the hostname and address columns. CreateHostnameAddressIndex = ` CREATE INDEX IF NOT EXISTS workers_hostname_address ON workers (hostname, address); ` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EngineOpt ¶
type EngineOpt func(*engine) error
EngineOpt represents a configuration option to initialize the database engine for Workers.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for Workers.
func WithContext ¶ added in v0.21.0
WithContext sets the context in the database engine for Workers.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Workers.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for Workers.
type WorkerInterface ¶ added in v0.20.0
type WorkerInterface interface { // CreateWorkerIndexes defines a function that creates the indexes for the workers table. CreateWorkerIndexes(context.Context) error // CreateWorkerTable defines a function that creates the workers table. CreateWorkerTable(context.Context, string) error // CountWorkers defines a function that gets the count of all workers. CountWorkers(context.Context) (int64, error) // CreateWorker defines a function that creates a new worker. CreateWorker(context.Context, *library.Worker) (*library.Worker, error) // DeleteWorker defines a function that deletes an existing worker. DeleteWorker(context.Context, *library.Worker) error // GetWorker defines a function that gets a worker by ID. GetWorker(context.Context, int64) (*library.Worker, error) // GetWorkerForHostname defines a function that gets a worker by hostname. GetWorkerForHostname(context.Context, string) (*library.Worker, error) // ListWorkers defines a function that gets a list of all workers. ListWorkers(context.Context) ([]*library.Worker, error) // UpdateWorker defines a function that updates an existing worker. UpdateWorker(context.Context, *library.Worker) (*library.Worker, error) }
WorkerInterface represents the Vela interface for worker functions with the supported Database backends.
Click to show internal directories.
Click to hide internal directories.