Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CreatePostgresTable represents a query to create the Postgres workers table. CreatePostgresTable = `` /* 275-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite workers table. CreateSqliteTable = `` /* 258-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 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 WorkerService ¶
type WorkerService interface { // CreateWorkerIndexes defines a function that creates the indexes for the workers table. CreateWorkerIndexes() error // CreateWorkerTable defines a function that creates the workers table. CreateWorkerTable(string) error // CountWorkers defines a function that gets the count of all workers. CountWorkers() (int64, error) // CreateWorker defines a function that creates a new worker. CreateWorker(*library.Worker) error // DeleteWorker defines a function that deletes an existing worker. DeleteWorker(*library.Worker) error // GetWorker defines a function that gets a worker by ID. GetWorker(int64) (*library.Worker, error) // GetWorkerForHostname defines a function that gets a worker by hostname. GetWorkerForHostname(string) (*library.Worker, error) // ListWorkers defines a function that gets a list of all workers. ListWorkers() ([]*library.Worker, error) // UpdateWorker defines a function that updates an existing worker. UpdateWorker(*library.Worker) error }
WorkerService represents the Vela interface for worker functions with the supported Database backends.
Click to show internal directories.
Click to hide internal directories.