lifecycletemplate

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package lifecycletemplate implements functionality related to Phobos lifecycle templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateLifecycleTemplateInput

type CreateLifecycleTemplateInput struct {
	OrganizationID *string
	ProjectID      *string
	Scope          models.ScopeType
}

CreateLifecycleTemplateInput is the input for creating a lifecycle template

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 lifecycle template data

func NewDataStore

func NewDataStore(objectStore objectstore.ObjectStore) DataStore

NewDataStore creates an instance of the DataStore interface

type GetLifecycleTemplatesInput

type GetLifecycleTemplatesInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.LifecycleTemplateSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// OrganizationID filters the lifecycle templates by the specified organization
	OrganizationID *string
	// ProjectID filters the lifecycle templates by the specified project
	ProjectID *string
	// LifecycleTemplateScopes will filter the lifecycle templates that are scope to specific level
	LifecycleTemplateScopes []models.ScopeType
}

GetLifecycleTemplatesInput is the input for querying a list of lifecycle 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 Service

type Service interface {
	GetLifecycleTemplateByID(ctx context.Context, id string) (*models.LifecycleTemplate, error)
	GetLifecycleTemplateByPRN(ctx context.Context, prn string) (*models.LifecycleTemplate, error)
	GetLifecycleTemplatesByIDs(ctx context.Context, idList []string) ([]*models.LifecycleTemplate, error)
	GetLifecycleTemplates(ctx context.Context, input *GetLifecycleTemplatesInput) (*db.LifecycleTemplatesResult, error)
	GetLifecycleTemplateData(ctx context.Context, id string) (io.ReadCloser, error)
	CreateLifecycleTemplate(ctx context.Context, input *CreateLifecycleTemplateInput) (*models.LifecycleTemplate, error)
	UploadLifecycleTemplate(ctx context.Context, input *UploadLifecycleTemplateInput) error
}

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

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 UploadLifecycleTemplateInput

type UploadLifecycleTemplateInput struct {
	Reader io.Reader
	ID     string
}

UploadLifecycleTemplateInput is the input for uploading to a lifecycle template

Jump to

Keyboard shortcuts

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