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

Function NewController

workers/entity/controller.go:34–48  ·  view source on GitHub ↗
(ctx context.Context, store dbCommon.Store, providers map[string]common.Provider)

Source from the content-addressed store, hash-verified

32const retryLoopInterval = 5 * time.Second
33
34func NewController(ctx context.Context, store dbCommon.Store, providers map[string]common.Provider) (*Controller, error) {
35 consumerID := "entity-controller"
36 ctx = garmUtil.WithSlogContext(
37 ctx,
38 slog.Any("worker", consumerID))
39 ctx = auth.GetAdminContext(ctx)
40
41 return &Controller{
42 consumerID: consumerID,
43 ctx: ctx,
44 store: store,
45 providers: providers,
46 backoff: workersCommon.NewBackoff(workersCommon.DefaultBackoffConfig()),
47 }, nil
48}
49
50type Controller struct {
51 consumerID string

Callers 1

mainFunction · 0.92

Calls 1

GetAdminContextFunction · 0.92

Tested by

no test coverage detected