@@ -24,11 +24,10 @@ import (
2424
2525var log = logging .Logger ("pubsub-valuestore" )
2626
27- // MinimalPubsub allows us to provide the bare minimum pubsub functionality
28- // to the router, while still using the same pubsub instance in other goroutines.
29- // This is primarily done to allow callers to not have to worry about topic management
30- // due to topics only allowing a single "joiner".
31- type MinimalPubsub interface {
27+ // Pubsub is the minimal subset of the pubsub interface required by the pubsub
28+ // value store. This way, users can wrap the underlying pubsub implementation
29+ // without re-exporting/implementing the entire interface.
30+ type Pubsub interface {
3231 RegisterTopicValidator (topic string , val pubsub.Validator , opts ... pubsub.ValidatorOpt ) error
3332 Join (topic string , opts ... pubsub.TopicOpt ) (* pubsub.Topic , error )
3433}
@@ -41,7 +40,7 @@ type watchGroup struct {
4140type PubsubValueStore struct {
4241 ctx context.Context
4342 ds ds.Datastore
44- ps MinimalPubsub
43+ ps Pubsub
4544
4645 host host.Host
4746 fetch * fetchProtocol
@@ -81,7 +80,7 @@ func KeyToTopic(key string) string {
8180type Option func (* PubsubValueStore ) error
8281
8382// NewPubsubValueStore constructs a new ValueStore that gets and receives records through pubsub.
84- func NewPubsubValueStore (ctx context.Context , host host.Host , ps MinimalPubsub , validator record.Validator , opts ... Option ) (* PubsubValueStore , error ) {
83+ func NewPubsubValueStore (ctx context.Context , host host.Host , ps Pubsub , validator record.Validator , opts ... Option ) (* PubsubValueStore , error ) {
8584 psValueStore := & PubsubValueStore {
8685 ctx : ctx ,
8786
0 commit comments