collector

package
v0.0.0-...-64e8fac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectLogResult

type CollectLogResult struct {
	LogObject  string
	LogURL     string
	LogContent string
}

type CollectObjectResult

type CollectObjectResult struct {
	PrObject string
	PrURL    string
}

type CollectResult

type CollectResult struct {
	Bucket         string
	LogObject      string
	PrObject       string
	Result         string
	StartTime      *metav1.Time
	CompletionTime *metav1.Time
}

type DummyCollector

type DummyCollector struct {
	// contains filtered or unexported fields
}

func (*DummyCollector) Collect

func (c *DummyCollector) Collect(ctx context.Context, pr *v1beta1.PipelineRun,
	horizonMetaData *global.HorizonMetaData) (*CollectResult, error)

func (*DummyCollector) GetPipelineRun

func (c *DummyCollector) GetPipelineRun(ctx context.Context,
	pr *prmodels.Pipelinerun) (*v1beta1.PipelineRun, error)

func (*DummyCollector) GetPipelineRunLog

func (c *DummyCollector) GetPipelineRunLog(ctx context.Context, pr *prmodels.Pipelinerun) (*Log, error)

func (*DummyCollector) GetPipelineRunObject

func (c *DummyCollector) GetPipelineRunObject(ctx context.Context,
	object string) (*Object, error)

type Interface

type Interface interface {
	// Collect log & object for pipelinerun
	Collect(ctx context.Context, pr *v1beta1.PipelineRun, horizonMetaData *global.HorizonMetaData) (*CollectResult, error)

	// GetPipelineRunLog gets pipelinerun log from collector
	GetPipelineRunLog(ctx context.Context, pr *prmodels.Pipelinerun) (*Log, error)

	// GetPipelineRunObject get pipelinerun object from collector
	GetPipelineRunObject(ctx context.Context, object string) (*Object, error)

	// GetPipelineRun gets tekton pipelinerun
	GetPipelineRun(ctx context.Context, pr *prmodels.Pipelinerun) (*v1beta1.PipelineRun, error)
}

nolint -package=mock_collector

func NewDummyCollector

func NewDummyCollector(tekton tekton.Interface) Interface

func NewS3Collector

func NewS3Collector(s3 s3.Interface, tekton tekton.Interface) Interface

type Log

type Log struct {
	LogChannel <-chan log.Log
	ErrChannel <-chan error

	LogBytes []byte
}

type LogAndURLStruct

type LogAndURLStruct struct {
	URL     string `json:"url"`
	Content string `json:"content"`
}

type LogStruct

type LogStruct struct {
	Object *MetadataAndURLStruct `json:"object"`
	Log    *LogAndURLStruct      `json:"log"`
}

func NewLogStruct

func NewLogStruct(prURL string, metadata *ObjectMeta, logURL string, logContent string) *LogStruct

type MetadataAndURLStruct

type MetadataAndURLStruct struct {
	URL      string      `json:"url"`
	Metadata *ObjectMeta `json:"metadata"`
}

type Object

type Object struct {
	// Metadata meta data
	Metadata *ObjectMeta `json:"metadata"`
	// PipelineRun v1beta1.PipelineRun
	PipelineRun *v1beta1.PipelineRun `json:"pipelineRun"`
}

Object the pipelinerun object to be collected

type ObjectMeta

type ObjectMeta struct {
	Application       string             `json:"application"`
	ApplicationID     string             `json:"applicationID"`
	Cluster           string             `json:"cluster"`
	ClusterID         string             `json:"clusterID"`
	Environment       string             `json:"environment"`
	Operator          string             `json:"operator"`
	CreationTimestamp string             `json:"creationTimestamp"`
	PipelineRun       *PipelineRunStatus `json:"pipelineRun"`
}

func NewObjectMeta

func NewObjectMeta(horizonMetaData *global.HorizonMetaData, pr *v1beta1.PipelineRun) *ObjectMeta

type PipelineRunStatus

type PipelineRunStatus struct {
	StatusMeta `json:",inline"`
	Pipeline   string `json:"pipeline"`
}

type S3Collector

type S3Collector struct {
	// contains filtered or unexported fields
}

func (*S3Collector) Collect

func (c *S3Collector) Collect(ctx context.Context, pr *v1beta1.PipelineRun, horizonMetaData *global.HorizonMetaData) (
	*CollectResult, error)

func (*S3Collector) GetPipelineRun

func (c *S3Collector) GetPipelineRun(ctx context.Context,
	pr *prmodels.Pipelinerun) (*v1beta1.PipelineRun, error)

func (*S3Collector) GetPipelineRunLog

func (c *S3Collector) GetPipelineRunLog(ctx context.Context, pr *prmodels.Pipelinerun) (*Log, error)

func (*S3Collector) GetPipelineRunObject

func (c *S3Collector) GetPipelineRunObject(ctx context.Context, object string) (_ *Object, err error)

type StatusMeta

type StatusMeta struct {
	Name            string       `json:"name"`
	Result          string       `json:"result"`
	DurationSeconds float64      `json:"durationSeconds"`
	StartTime       *metav1.Time `json:"startTime"`
	CompletionTime  *metav1.Time `json:"completionTime"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL