Documentation
¶
Index ¶
- Constants
- Variables
- func ValidateProvisionInput(input ProvisionInput) error
- type BucketReady
- type CreateOptions
- type DeleteOptions
- type ProvisionInput
- type Service
- func (s *Service) Create(ctx context.Context, name string) (*model.Bucket, error)
- func (s *Service) CreateWithACL(ctx context.Context, name string, acl []byte) (*model.Bucket, error)
- func (s *Service) CreateWithOptions(ctx context.Context, options CreateOptions) (*model.Bucket, error)
- func (s *Service) Delete(_ context.Context, _ string, _ DeleteOptions) (*model.Bucket, error)
- func (s *Service) EnsureCacheBucketDir(ctx context.Context, name string)
- func (s *Service) ScheduleProvision(ctx context.Context, repos *repository.Repositories, bucket *model.Bucket) error
- func (s *Service) SetTaskService(service *taskengine.Service)
Constants ¶
const MessageBucketReady = "bucket.ready"
Variables ¶
Functions ¶
func ValidateProvisionInput ¶
func ValidateProvisionInput(input ProvisionInput) error
Types ¶
type BucketReady ¶
type BucketReady struct{ BucketID int64 }
func (BucketReady) MessageType ¶
func (BucketReady) MessageType() string
type CreateOptions ¶
type DeleteOptions ¶
type DeleteOptions struct {
Recursive bool
}
type ProvisionInput ¶
ProvisionInput identifies the bucket whose provider storage must be ready for a replica target. The target is the task's generation, so raising it schedules a fresh run instead of colliding with the completed one that provisioned the smaller target.
This is only sound while the target can never go down: a target that returned to an earlier value would name a round that already completed, and the slots opened for it would never be provisioned. Whoever implements lowering has to replace it with a monotonic generation first.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates bucket lifecycle operations shared by multiple entrypoints.
func New ¶
func New(repos *repository.Repositories, c cache.Cache, defaultCopies int, logger *slog.Logger) *Service
func (*Service) CreateWithACL ¶
func (*Service) CreateWithOptions ¶
func (*Service) EnsureCacheBucketDir ¶
func (*Service) ScheduleProvision ¶
func (s *Service) ScheduleProvision(ctx context.Context, repos *repository.Repositories, bucket *model.Bucket) error
ScheduleProvision enqueues provisioning for the bucket's current replica target. It is idempotent per target: raising the target schedules the slots that were just opened, lowering it schedules a run that finds nothing to do.
func (*Service) SetTaskService ¶
func (s *Service) SetTaskService(service *taskengine.Service)