Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CreatePostgresTable represents a query to create the Postgres services table. CreatePostgresTable = `` /* 474-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite services table. CreateSqliteTable = `` /* 433-byte string literal not displayed */ )
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 Services.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for Services.
func WithContext ¶ added in v0.21.0
WithContext sets the context in the database engine for Services.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Services.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for Services.
type ServiceInterface ¶
type ServiceInterface interface {
// CreateServiceTable defines a function that creates the services table.
CreateServiceTable(context.Context, string) error
// CleanServices defines a function that sets running or pending services to error status before a given created time.
CleanServices(context.Context, string, int64) (int64, error)
// CountServices defines a function that gets the count of all services.
CountServices(context.Context) (int64, error)
// CountServicesForBuild defines a function that gets the count of services by build ID.
CountServicesForBuild(context.Context, *library.Build, map[string]interface{}) (int64, error)
// CreateService defines a function that creates a new service.
CreateService(context.Context, *library.Service) (*library.Service, error)
// DeleteService defines a function that deletes an existing service.
DeleteService(context.Context, *library.Service) error
// GetService defines a function that gets a service by ID.
GetService(context.Context, int64) (*library.Service, error)
// GetServiceForBuild defines a function that gets a service by number and build ID.
GetServiceForBuild(context.Context, *library.Build, int) (*library.Service, error)
// ListServices defines a function that gets a list of all services.
ListServices(context.Context) ([]*library.Service, error)
// ListServicesForBuild defines a function that gets a list of services by build ID.
ListServicesForBuild(context.Context, *library.Build, map[string]interface{}, int, int) ([]*library.Service, int64, error)
// ListServiceImageCount defines a function that gets a list of all service images and the count of their occurrence.
ListServiceImageCount(context.Context) (map[string]float64, error)
// ListServiceStatusCount defines a function that gets a list of all service statuses and the count of their occurrence.
ListServiceStatusCount(context.Context) (map[string]float64, error)
// UpdateService defines a function that updates an existing service.
UpdateService(context.Context, *library.Service) (*library.Service, error)
}
ServiceInterface represents the Vela interface for service functions with the supported Database backends.
Click to show internal directories.
Click to hide internal directories.