pipelinetemplate

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package pipelinetemplate implements functionality related to Phobos pipeline templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePipelineTemplateInput

type CreatePipelineTemplateInput struct {
	Name            *string
	SemanticVersion *string
	ProjectID       string
	Versioned       bool
}

CreatePipelineTemplateInput is the input for creating a pipeline template Name and SemanticVersion are required if Versioned is true, prohibited if Versioned is false.

type DataStore

type DataStore interface {
	UploadData(ctx context.Context, inputID string, inputReader io.Reader) error
	GetData(ctx context.Context, inputID string) (io.ReadCloser, error)
}

DataStore interface encapsulates the logic for saving and retrieving pipeline template data

func NewDataStore

func NewDataStore(objectStore objectstore.ObjectStore) DataStore

NewDataStore creates an instance of the DataStore interface

type DeletePipelineTemplateInput

type DeletePipelineTemplateInput struct {
	Version *int
	ID      string
}

DeletePipelineTemplateInput is the input for deleting a pipeline template.

type GetPipelineTemplatesInput

type GetPipelineTemplatesInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.PipelineTemplateSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// Versioned filters the pipeline templates by whether they are versioned.
	Versioned *bool
	// Latest filters the pipeline templates by whether they are the latest version.
	Latest *bool
	// Name filters the pipeline templates by exact name (which implies versioned=true)
	Name *string
	// Search filters the pipeline templates by name prefix (which implies versioned=true)
	Search *string
	// ProjectID filters the pipeline templates by the specified project
	ProjectID string
}

GetPipelineTemplatesInput is the input for querying a list of pipeline templates

type MockDataStore

type MockDataStore struct {
	mock.Mock
}

MockDataStore is an autogenerated mock type for the DataStore type

func NewMockDataStore

func NewMockDataStore(t mockConstructorTestingTNewMockDataStore) *MockDataStore

NewMockDataStore creates a new instance of MockDataStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockDataStore) GetData

func (_m *MockDataStore) GetData(ctx context.Context, inputID string) (io.ReadCloser, error)

GetData provides a mock function with given fields: ctx, inputID

func (*MockDataStore) UploadData

func (_m *MockDataStore) UploadData(ctx context.Context, inputID string, inputReader io.Reader) error

UploadData provides a mock function with given fields: ctx, inputID, inputReader

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock type for the Service type

func NewMockService

func NewMockService(t mockConstructorTestingTNewMockService) *MockService

NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockService) CreatePipelineTemplate

func (_m *MockService) CreatePipelineTemplate(ctx context.Context, input *CreatePipelineTemplateInput) (*models.PipelineTemplate, error)

CreatePipelineTemplate provides a mock function with given fields: ctx, input

func (*MockService) DeletePipelineTemplate

func (_m *MockService) DeletePipelineTemplate(ctx context.Context, input *DeletePipelineTemplateInput) error

DeletePipelineTemplate provides a mock function with given fields: ctx, input

func (*MockService) GetPipelineTemplateByID

func (_m *MockService) GetPipelineTemplateByID(ctx context.Context, id string) (*models.PipelineTemplate, error)

GetPipelineTemplateByID provides a mock function with given fields: ctx, id

func (*MockService) GetPipelineTemplateByPRN

func (_m *MockService) GetPipelineTemplateByPRN(ctx context.Context, prn string) (*models.PipelineTemplate, error)

GetPipelineTemplateByPRN provides a mock function with given fields: ctx, prn

func (*MockService) GetPipelineTemplateData

func (_m *MockService) GetPipelineTemplateData(ctx context.Context, id string) (io.ReadCloser, error)

GetPipelineTemplateData provides a mock function with given fields: ctx, id

func (*MockService) GetPipelineTemplates

func (_m *MockService) GetPipelineTemplates(ctx context.Context, input *GetPipelineTemplatesInput) (*db.PipelineTemplatesResult, error)

GetPipelineTemplates provides a mock function with given fields: ctx, input

func (*MockService) GetPipelineTemplatesByIDs

func (_m *MockService) GetPipelineTemplatesByIDs(ctx context.Context, idList []string) ([]models.PipelineTemplate, error)

GetPipelineTemplatesByIDs provides a mock function with given fields: ctx, idList

func (*MockService) UploadPipelineTemplate

func (_m *MockService) UploadPipelineTemplate(ctx context.Context, input *UploadPipelineTemplateInput) error

UploadPipelineTemplate provides a mock function with given fields: ctx, input

type Service

type Service interface {
	GetPipelineTemplateByID(ctx context.Context, id string) (*models.PipelineTemplate, error)
	GetPipelineTemplateByPRN(ctx context.Context, prn string) (*models.PipelineTemplate, error)
	GetPipelineTemplatesByIDs(ctx context.Context, idList []string) ([]models.PipelineTemplate, error)
	GetPipelineTemplates(ctx context.Context, input *GetPipelineTemplatesInput) (*db.PipelineTemplatesResult, error)
	GetPipelineTemplateData(ctx context.Context, id string) (io.ReadCloser, error)
	CreatePipelineTemplate(ctx context.Context, input *CreatePipelineTemplateInput) (*models.PipelineTemplate, error)
	UploadPipelineTemplate(ctx context.Context, input *UploadPipelineTemplateInput) error
	DeletePipelineTemplate(ctx context.Context, input *DeletePipelineTemplateInput) error
}

Service implements all pipeline template related functionality Please note the HCL data is NOT returned by the Get... methods other than GetPipelineTemplateData.

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
	limitChecker limits.LimitChecker,
	dataStore DataStore,
	activityService activityevent.Service,
) Service

NewService returns an instance of Service

type UploadPipelineTemplateInput

type UploadPipelineTemplateInput struct {
	Reader io.Reader
	ID     string
}

UploadPipelineTemplateInput is the input for uploading to a pipeline template

Jump to

Keyboard shortcuts

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