service

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildState

type BuildState int
const (
	BuildStateInternalError BuildState = iota
	BuildStateConfigError
	BuildStateSuccess
	BuildStateSyncFailed
	BuildStateTransformFailed
	BuildStateBuildFailed
	BuildStatePushFailed
)

func (BuildState) String

func (s BuildState) String() string

type BundleWorker

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

BundleWorker is responsible for constructing a bundle from the source dependencies and uploading it to an object storage service. It uses a git synchronizer to pull the latest changes from the source repositories, constructs a bundle using the builder package, and uploads the resulting bundle to an S3-compatible object storage service.

func NewBundleWorker

func NewBundleWorker(bundleDir string, b *config.Bundle, sources []*config.Source, stacks []*config.Stack, logger *logging.Logger, bar *progress.Bar) *BundleWorker

func (*BundleWorker) Done

func (worker *BundleWorker) Done() bool

func (*BundleWorker) Execute

func (w *BundleWorker) Execute(ctx context.Context) time.Time

Execute runs a bundle synchronization iteration: git sync, bundle construct and then push bundles to object storage.

func (*BundleWorker) UpdateConfig

func (worker *BundleWorker) UpdateConfig(b *config.Bundle, sources []*config.Source, stacks []*config.Stack)

func (*BundleWorker) WithInterval

func (worker *BundleWorker) WithInterval(d config.Duration) *BundleWorker

func (*BundleWorker) WithSingleShot

func (worker *BundleWorker) WithSingleShot(singleShot bool) *BundleWorker

func (*BundleWorker) WithSources

func (worker *BundleWorker) WithSources(sources []*builder.Source) *BundleWorker

func (*BundleWorker) WithStorage

func (worker *BundleWorker) WithStorage(storage s3.ObjectStorage) *BundleWorker

func (*BundleWorker) WithSynchronizers

func (worker *BundleWorker) WithSynchronizers(synchronizers []Synchronizer) *BundleWorker

type Report

type Report struct {
	Bundles map[string]Status
}

type Service

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

func New

func New() *Service

func (*Service) Database

func (s *Service) Database() *database.Database

func (*Service) Init

func (s *Service) Init(ctx context.Context) error

func (*Service) Ready

func (s *Service) Ready(context.Context) error

func (*Service) Report

func (s *Service) Report() *Report

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

func (*Service) WithBuiltinFS

func (s *Service) WithBuiltinFS(fs fs.FS) *Service

func (*Service) WithConfig

func (s *Service) WithConfig(config *config.Root) *Service

func (*Service) WithLogger

func (s *Service) WithLogger(logger *logging.Logger) *Service

func (*Service) WithMigrateDB

func (s *Service) WithMigrateDB(yes bool) *Service

func (*Service) WithNoninteractive

func (s *Service) WithNoninteractive(yes bool) *Service

func (*Service) WithPersistenceDir

func (s *Service) WithPersistenceDir(d string) *Service

func (*Service) WithSingleShot

func (s *Service) WithSingleShot(singleShot bool) *Service

type Status

type Status struct {
	State   BuildState
	Message string
}

type Synchronizer

type Synchronizer interface {
	Execute(ctx context.Context) error
	Close(ctx context.Context)
}

Jump to

Keyboard shortcuts

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