github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/pkg/storage/bucket/user_bucket_client.go (about)

     1  package bucket
     2  
     3  import (
     4  	"github.com/thanos-io/thanos/pkg/objstore"
     5  )
     6  
     7  // NewUserBucketClient returns a bucket client to use to access the storage on behalf of the provided user.
     8  // The cfgProvider can be nil.
     9  func NewUserBucketClient(userID string, bucket objstore.Bucket, cfgProvider TenantConfigProvider) objstore.InstrumentedBucket {
    10  	// Inject the user/tenant prefix.
    11  	bucket = NewPrefixedBucketClient(bucket, userID)
    12  
    13  	// Inject the SSE config.
    14  	return NewSSEBucketClient(userID, bucket, cfgProvider)
    15  }