service

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRevisionLength = 255

MaxRevisionLength is the maximum allowed length for a resolved revision string. This matches the VARCHAR(255) column size used for revisions in MySQL and PostgreSQL.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildPhase

type BuildPhase int
const (
	BuildPhaseBuild BuildPhase = iota
	BuildPhasePush
)

func (BuildPhase) String

func (s BuildPhase) String() string

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) WithDatabase

func (worker *BundleWorker) WithDatabase(database *database.Database) *BundleWorker

func (*BundleWorker) WithInterval

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

func (*BundleWorker) WithMetrics added in v0.7.0

func (worker *BundleWorker) WithMetrics(m *metrics.Metrics) *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 ext_os.ObjectStorage) *BundleWorker

func (*BundleWorker) WithSynchronizers

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

func (*BundleWorker) WithTenant

func (worker *BundleWorker) WithTenant(tenant string) *BundleWorker

type ReferencedSource

type ReferencedSource struct {
	SourceName string
	Fields     []string // e.g., ["hashsum"], ["commit"]
}

ReferencedSource represents a source that is referenced in the revision expression

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) WithAuthorizer

func (s *Service) WithAuthorizer(a ext_authz.Authorizer) *Service

func (*Service) WithBuiltinFS

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

func (*Service) WithConfig

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

func (*Service) WithDatabaseConfig added in v0.7.0

func (s *Service) WithDatabaseConfig(cfg *pkgconfig.DatabaseConfig) *Service

WithDatabaseConfig configures the database connection from a typed struct instead of raw JSON/YAML bytes.

func (*Service) WithLogger

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

func (*Service) WithMetrics added in v0.7.0

func (s *Service) WithMetrics(m *metrics.Metrics) *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) WithRawConfig

func (s *Service) WithRawConfig(rawConfig []byte) *Service

func (*Service) WithSecretProviderFactory

func (s *Service) WithSecretProviderFactory(factory pkgsync.SecretProviderFactory) *Service

func (*Service) WithSingleShot

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

func (*Service) WithSlogLogger

func (s *Service) WithSlogLogger(logger *slog.Logger) *Service

WithSlogLogger sets the service logger from a standard *slog.Logger.

func (*Service) WithStorage

func (s *Service) WithStorage(storage ext_os.ObjectStorage) *Service

type Status

type Status struct {
	State   BuildState
	Message string
}

type Synchronizer

type Synchronizer interface {
	Execute(ctx context.Context) (map[string]any, error)
	Close(ctx context.Context)
}

Jump to

Keyboard shortcuts

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