task

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package task centralizes code related to managing tasks in the application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFilename

func GenerateFilename(data RunnerData) string

GenerateFilename returns a statically generated filename considering some environment parameters

Types

type Data

type Data struct {
	TaskARN     string
	ContainerIP string
	PrivateKey  []byte
}

Data centralizes attributes that should be persisted in the metadata storage

type MetadataManager

type MetadataManager interface {
	// Persist stores the desired data
	Persist(data Data) error

	// Get fetches existing data from the metadata storage
	Get() (Data, error)

	// Clear removes existing data
	Clear() error
}

MetadataManager represents a repository to store temporary data related to task information

func NewMetadataManager

func NewMetadataManager(logger logging.Logger, filesDir string) MetadataManager

NewMetadataManager is a constructor for the concrete type of the MetadataManager interface

type MockMetadataManager

type MockMetadataManager struct {
	mock.Mock
}

MockMetadataManager is an autogenerated mock type for the MetadataManager type

func NewMockMetadataManager added in v0.3.0

func NewMockMetadataManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockMetadataManager

NewMockMetadataManager creates a new instance of MockMetadataManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockMetadataManager) Clear

func (_m *MockMetadataManager) Clear() error

Clear provides a mock function with no fields

func (*MockMetadataManager) Get

func (_m *MockMetadataManager) Get() (Data, error)

Get provides a mock function with no fields

func (*MockMetadataManager) Persist

func (_m *MockMetadataManager) Persist(data Data) error

Persist provides a mock function with given fields: data

type RunnerData

type RunnerData struct {
	ShortToken string
	ProjectURL string
	PipelineID int64
	JobID      int64
}

RunnerData centralizes the necessary attributes for generating the filename

Jump to

Keyboard shortcuts

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