Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadProjects ¶
func ReadProjects(ctx context.Context, client *gitlab.Client, opts Options) <-chan pooling.PoolerFunc
ReadProjects reads all projects from gitlab api and send them into the output channel. The output channel is closed once all projects were sent into it.
Types ¶
type Artifact ¶
type Artifact struct {
Size int
}
Artifact represents a simplified view of a gitlab artifact.
type Job ¶
type Job struct { Artifacts []Artifact `builder:"append"` ArtifactsExpireAt time.Time ID int ProjectID int }
Job is a simplified view of a gitlab job with only useful information for artifacts deletion feature.
func (Job) DeleteArtifacts ¶
func (j Job) DeleteArtifacts(ctx context.Context, client *gitlab.Client) pooling.PoolerFunc
DeleteArtifacts returns a pooling PoolerFunc to be executed in a specific pool to delete job's artifacts.
If a specific job doesn't have artifacts, then nothing will be done in the returned function.
type Options ¶
type Options struct { DryRun bool PathRegexps []*regexp.Regexp `builder:"append"` Paths []string `builder:"append" validate:"required,dive,required"` ThresholdSize int ` validate:"required,gt=0"` ThresholdDuration time.Duration ` validate:"required,gt=0"` ThresholdTime time.Time }
Options is the struct containing all available options in artifacts command.
func (*Options) EnsureDefaults ¶
EnsureDefaults ensures that all options in CleanOpts are valid or valued with their default values.
type Project ¶
Project is a simplified view of a gitlab project with only useful information used during artifacts command.
func (Project) CleanArtifacts ¶
func (p Project) CleanArtifacts(ctx context.Context, client *gitlab.Client, opts Options) pooling.PoolerFunc
CleanArtifacts returns the function to clean artifacts a specific project.
This function retrieves all project's jobs and send them into pooling PoolerFunc input channel.