Documentation
¶
Index ¶
- Constants
- type Engine
- func (e *Engine) CountLogs(ctx context.Context) (int64, error)
- func (e *Engine) CountLogsForBuild(ctx context.Context, b *api.Build) (int64, error)
- func (e *Engine) CreateLog(ctx context.Context, l *api.Log) error
- func (e *Engine) CreateLogIndexes(ctx context.Context) error
- func (e *Engine) CreateLogTable(ctx context.Context, driver string) error
- func (e *Engine) DeleteLog(ctx context.Context, l *api.Log) error
- func (e *Engine) GetLog(ctx context.Context, id int64) (*api.Log, error)
- func (e *Engine) GetLogForService(ctx context.Context, s *api.Service) (*api.Log, error)
- func (e *Engine) GetLogForStep(ctx context.Context, s *api.Step) (*api.Log, error)
- func (e *Engine) ListLogs(ctx context.Context) ([]*api.Log, error)
- func (e *Engine) ListLogsForBuild(ctx context.Context, b *api.Build, page, perPage int) ([]*api.Log, error)
- func (e *Engine) UpdateLog(ctx context.Context, l *api.Log) error
- type EngineOpt
- type LogInterface
Constants ¶
const ( // CreatePostgresTable represents a query to create the Postgres logs table. CreatePostgresTable = `` /* 251-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite logs table. CreateSqliteTable = `` /* 267-byte string literal not displayed */ )
const ( // CreateBuildIDIndex represents a query to create an // index on the logs table for the build_id column. CreateBuildIDIndex = ` CREATE INDEX IF NOT EXISTS logs_build_id ON logs (build_id); ` )
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 log functionality that implements the LogInterface interface.
func (*Engine) CountLogsForBuild ¶ added in v0.27.0
CountLogsForBuild gets the count of logs by build ID from the database.
func (*Engine) CreateLogIndexes ¶ added in v0.27.0
CreateLogIndexes creates the indexes for the logs table in the database.
func (*Engine) CreateLogTable ¶ added in v0.27.0
CreateLogTable creates the logs table in the database.
func (*Engine) GetLogForService ¶ added in v0.27.0
GetLogForService gets a log by service ID from the database.
func (*Engine) GetLogForStep ¶ added in v0.27.0
GetLogForStep gets a log by step ID from the database.
type EngineOpt ¶
EngineOpt represents a configuration option to initialize the database engine for Logs.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for Logs.
func WithCompressionLevel ¶
WithCompressionLevel sets the compression level in the database engine for Logs.
func WithContext ¶ added in v0.21.0
WithContext sets the context in the database engine for Logs.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Logs.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for Logs.
type LogInterface ¶ added in v0.20.0
type LogInterface interface {
// CreateLogIndexes defines a function that creates the indexes for the logs table.
CreateLogIndexes(context.Context) error
// CreateLogTable defines a function that creates the logs table.
CreateLogTable(context.Context, string) error
// CountLogs defines a function that gets the count of all logs.
CountLogs(context.Context) (int64, error)
// CountLogsForBuild defines a function that gets the count of logs by build ID.
CountLogsForBuild(context.Context, *api.Build) (int64, error)
// CreateLog defines a function that creates a new log.
CreateLog(context.Context, *api.Log) error
// DeleteLog defines a function that deletes an existing log.
DeleteLog(context.Context, *api.Log) error
// GetLog defines a function that gets a log by ID.
GetLog(context.Context, int64) (*api.Log, error)
// GetLogForService defines a function that gets a log by service ID.
GetLogForService(context.Context, *api.Service) (*api.Log, error)
// GetLogForStep defines a function that gets a log by step ID.
GetLogForStep(context.Context, *api.Step) (*api.Log, error)
// ListLogs defines a function that gets a list of all logs.
ListLogs(context.Context) ([]*api.Log, error)
// ListLogsForBuild defines a function that gets a list of logs by build ID.
ListLogsForBuild(context.Context, *api.Build, int, int) ([]*api.Log, error)
// UpdateLog defines a function that updates an existing log.
UpdateLog(context.Context, *api.Log) error
}
LogInterface represents the Vela interface for log functions with the supported Database backends.