MCPcopy Create free account
hub / github.com/cloudbase/garm / NewWorker

Function NewWorker

workers/entity/worker.go:37–51  ·  view source on GitHub ↗
(ctx context.Context, store dbCommon.Store, entity params.ForgeEntity, providers map[string]common.Provider)

Source from the content-addressed store, hash-verified

35)
36
37func NewWorker(ctx context.Context, store dbCommon.Store, entity params.ForgeEntity, providers map[string]common.Provider) (*Worker, error) {
38 consumerID := fmt.Sprintf("entity-worker-%s", entity.ID)
39
40 ctx = garmUtil.WithSlogContext(
41 ctx,
42 slog.Any("worker", consumerID))
43
44 return &Worker{
45 ctx: ctx,
46 consumerID: consumerID,
47 store: store,
48 Entity: entity,
49 providers: providers,
50 }, nil
51}
52
53type Worker struct {
54 ctx context.Context

Callers 2

storeEntityWorkerMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected