package host import ( "context" "crypto/ed25519" "crypto/rand" "encoding/hex" "time" "github.com/carlosframework/platform/internal/hostactors" "github.com/carlosframework/platform/internal/hostops" "github.com/carlosframework/platform/internal/hostwrite" "github.com/carlosframework/platform/internal/release" ) func newClaimBackfill(writes hostwrite.Config, s release.Store, pub ed25519.PublicKey, bucket string) func(context.Context) error { if !writes.Enabled { return func(context.Context) error { return nil } } if s == nil || len(pub) == 0 || bucket == "" { return func(context.Context) error { return hostops.ErrContract } } d := hostactors.Directory{Store: s, PublicKey: pub, Bucket: bucket} c := hostops.NewBackfillController(s, d, time.Now, func() string { var b [16]byte if _, err := rand.Read(b[:]); err != nil { return "" } return hex.EncodeToString(b[:]) }) return c.ReconcileClaims }