// New returns a new instance of an unpublished operation store.
// This method will also register the unpublished operation store with the given expiry service which will then take
// care of deleting expired data automatically. Note that it's the caller's responsibility to start the expiry service.
// unpublishedOperationLifespan defines how long unpublished operations can stay in the store before being flagged
// for deletion.
New returns a new instance of an unpublished operation store.
This method will also register the unpublished operation store with the given expiry service which will then take
care of deleting expired data automatically. Note that it's the caller's responsibility to start the expiry service.
unpublishedOperationLifespan defines how long unpublished operations can stay in the store before being flagged
for deletion.
// New returns a new instance of an unpublished operation store . // This method will also register the unpublished operation store with the given expiry service which will then take // care of deleting expired data automatically . Note that it ' s the caller ' s responsibility to start the expiry service . // unpublishedOperationLifespan defines how long unpublished operations can stay in the store before being flagged // for deletion .
func New(provider storage.Provider, unpublishedOperationLifespan time.Duration,
	expiryService *expiry.Service, metrics metricsProvider) (*Store, error) {
	store, err := provider.OpenStore(nameSpace)
	if err != nil {
		return nil, fmt.Errorf("failed to open unpublished operation store: %w", err)
	}
	err = provider.SetStoreConfig(nameSpace, storage.StoreConfiguration{TagNames: []string{expiryTagName, index}})
	if err != nil {
		return nil, fmt.Errorf("failed to set store configuration on unpublished operation store: %w", err)
	}
	expiryService.Register(store, expiryTagName, nameSpace)
	return &Store{
		store:                        store,
		unpublishedOperationLifespan: unpublishedOperationLifespan,
		metrics: metrics,
	}, nil
}
func New ( provider storage . Provider , unpublishedOperationLifespan time . Duration , expiryService * expiry . Service , metrics metricsProvider ) ( * Store , error ) { store , err := provider . OpenStore ( nameSpace ) if err != nil { return nil , fmt . Errorf ( " " , err ) } err = provider . SetStoreConfig ( nameSpace , storage . StoreConfiguration { TagNames : [ ] string { expiryTagName , index } } ) if err != nil { return nil , fmt . Errorf ( " " , err ) } expiryService . Register ( store , expiryTagName , nameSpace ) return & Store { store : store , unpublishedOperationLifespan : unpublishedOperationLifespan , metrics : metrics , } , nil }
New returns a new instance of an unpublished operation store.
New returns a new instance of an unpublished operation store .