Documentation
¶
Index ¶
- Constants
- type Engine
- func (e *Engine) CleanServices(ctx context.Context, msg string, before int64) (int64, error)
- func (e *Engine) CountServices(ctx context.Context) (int64, error)
- func (e *Engine) CountServicesForBuild(ctx context.Context, b *api.Build, filters map[string]interface{}) (int64, error)
- func (e *Engine) CreateService(ctx context.Context, s *api.Service) (*api.Service, error)
- func (e *Engine) CreateServiceTable(ctx context.Context, driver string) error
- func (e *Engine) DeleteService(ctx context.Context, s *api.Service) error
- func (e *Engine) GetService(ctx context.Context, id int64) (*api.Service, error)
- func (e *Engine) GetServiceForBuild(ctx context.Context, b *api.Build, number int32) (*api.Service, error)
- func (e *Engine) ListServiceImageCount(ctx context.Context) (map[string]float64, error)
- func (e *Engine) ListServiceStatusCount(ctx context.Context) (map[string]float64, error)
- func (e *Engine) ListServices(ctx context.Context) ([]*api.Service, error)
- func (e *Engine) ListServicesForBuild(ctx context.Context, b *api.Build, filters map[string]interface{}, page int, ...) ([]*api.Service, error)
- func (e *Engine) UpdateService(ctx context.Context, s *api.Service) (*api.Service, error)
- type EngineOpt
- type ServiceInterface
Constants ¶
const ( // CreatePostgresTable represents a query to create the Postgres services table. CreatePostgresTable = `` /* 472-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 ¶
This section is empty.
Types ¶
type Engine ¶ added in v0.27.0
type Engine struct {
// contains filtered or unexported fields
}
Engine represents the service functionality that implements the ServiceInterface interface.
func (*Engine) CleanServices ¶ added in v0.27.0
CleanServices updates services to an error with a created timestamp prior to a defined moment.
func (*Engine) CountServices ¶ added in v0.27.0
CountServices gets the count of all services from the database.
func (*Engine) CountServicesForBuild ¶ added in v0.27.0
func (e *Engine) CountServicesForBuild(ctx context.Context, b *api.Build, filters map[string]interface{}) (int64, error)
CountServicesForBuild gets the count of services by build ID from the database.
func (*Engine) CreateService ¶ added in v0.27.0
CreateService creates a new service in the database.
func (*Engine) CreateServiceTable ¶ added in v0.27.0
CreateServiceTable creates the services table in the database.
func (*Engine) DeleteService ¶ added in v0.27.0
DeleteService deletes an existing service from the database.
func (*Engine) GetService ¶ added in v0.27.0
GetService gets a service by ID from the database.
func (*Engine) GetServiceForBuild ¶ added in v0.27.0
func (e *Engine) GetServiceForBuild(ctx context.Context, b *api.Build, number int32) (*api.Service, error)
GetServiceForBuild gets a service by number and build ID from the database.
func (*Engine) ListServiceImageCount ¶ added in v0.27.0
ListServiceImageCount gets a list of all service images and the count of their occurrence from the database.
func (*Engine) ListServiceStatusCount ¶ added in v0.27.0
ListServiceStatusCount gets a list of all service statuses and the count of their occurrence from the database.
func (*Engine) ListServices ¶ added in v0.27.0
ListServices gets a list of all services from the database.
type EngineOpt ¶
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, *api.Build, map[string]interface{}) (int64, error)
// CreateService defines a function that creates a new service.
CreateService(context.Context, *api.Service) (*api.Service, error)
// DeleteService defines a function that deletes an existing service.
DeleteService(context.Context, *api.Service) error
// GetService defines a function that gets a service by ID.
GetService(context.Context, int64) (*api.Service, error)
// GetServiceForBuild defines a function that gets a service by number and build ID.
GetServiceForBuild(context.Context, *api.Build, int32) (*api.Service, error)
// ListServices defines a function that gets a list of all services.
ListServices(context.Context) ([]*api.Service, error)
// ListServicesForBuild defines a function that gets a list of services by build ID.
ListServicesForBuild(context.Context, *api.Build, map[string]interface{}, int, int) ([]*api.Service, 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, *api.Service) (*api.Service, error)
}