Documentation
¶
Index ¶
- Variables
- func NewBigtableObjectClient(ctx context.Context, cfg Config, schemaCfg chunk.SchemaConfig) (chunk.Client, error)
- func NewStorageClientColumnKey(ctx context.Context, cfg Config, schemaCfg chunk.SchemaConfig) (chunk.IndexClient, error)
- func NewStorageClientV1(ctx context.Context, cfg Config, schemaCfg chunk.SchemaConfig) (chunk.IndexClient, error)
- func NewTableClient(ctx context.Context, cfg Config) (chunk.TableClient, error)
- type Config
- type GCSConfig
- type GCSObjectClient
- func (s *GCSObjectClient) DeleteObject(ctx context.Context, objectKey string) error
- func (s *GCSObjectClient) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, error)
- func (s *GCSObjectClient) List(ctx context.Context, prefix string) ([]chunk.StorageObject, error)
- func (s *GCSObjectClient) PutObject(ctx context.Context, objectKey string, object io.ReadSeeker) error
- func (s *GCSObjectClient) Stop()
Constants ¶
This section is empty.
Variables ¶
var Fixtures = func() []testutils.Fixture {
fixtures := []testutils.Fixture{}
for _, gcsObjectClient := range []bool{true, false} {
for _, columnKeyClient := range []bool{true, false} {
for _, hashPrefix := range []bool{true, false} {
fixtures = append(fixtures, &fixture{
name: fmt.Sprintf("bigtable-columnkey:%v-gcsObjectClient:%v-hashPrefix:%v", columnKeyClient, gcsObjectClient, hashPrefix),
columnKeyClient: columnKeyClient,
gcsObjectClient: gcsObjectClient,
hashPrefix: hashPrefix,
})
}
}
}
return fixtures
}()
Fixtures for unit testing GCP storage.
Functions ¶
func NewBigtableObjectClient ¶
func NewBigtableObjectClient(ctx context.Context, cfg Config, schemaCfg chunk.SchemaConfig) (chunk.Client, error)
NewBigtableObjectClient makes a new chunk.Client that stores chunks in Bigtable.
func NewStorageClientColumnKey ¶
func NewStorageClientColumnKey(ctx context.Context, cfg Config, schemaCfg chunk.SchemaConfig) (chunk.IndexClient, error)
NewStorageClientColumnKey returns a new v2 StorageClient.
func NewStorageClientV1 ¶
func NewStorageClientV1(ctx context.Context, cfg Config, schemaCfg chunk.SchemaConfig) (chunk.IndexClient, error)
NewStorageClientV1 returns a new v1 StorageClient.
func NewTableClient ¶
func NewTableClient(ctx context.Context, cfg Config) (chunk.TableClient, error)
NewTableClient returns a new TableClient.
Types ¶
type Config ¶
type Config struct {
Project string `yaml:"project"`
Instance string `yaml:"instance"`
GRPCClientConfig grpcclient.Config `yaml:"grpc_client_config"`
ColumnKey bool `yaml:"-"`
DistributeKeys bool `yaml:"-"`
TableCacheEnabled bool `yaml:"table_cache_enabled"`
TableCacheExpiration time.Duration `yaml:"table_cache_expiration"`
}
Config for a StorageClient
func (*Config) RegisterFlags ¶
func (cfg *Config) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
type GCSConfig ¶
type GCSConfig struct {
BucketName string `yaml:"bucket_name"`
ChunkBufferSize int `yaml:"chunk_buffer_size"`
RequestTimeout time.Duration `yaml:"request_timeout"`
}
GCSConfig is config for the GCS Chunk Client.
func (*GCSConfig) RegisterFlags ¶
func (cfg *GCSConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers flags.
func (*GCSConfig) RegisterFlagsWithPrefix ¶ added in v0.7.0
func (cfg *GCSConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix registers flags with prefix.
type GCSObjectClient ¶ added in v0.7.0
type GCSObjectClient struct {
// contains filtered or unexported fields
}
func NewGCSObjectClient ¶
func NewGCSObjectClient(ctx context.Context, cfg GCSConfig, delimiter string) (*GCSObjectClient, error)
NewGCSObjectClient makes a new chunk.Client that writes chunks to GCS.
func (*GCSObjectClient) DeleteObject ¶ added in v0.7.0
func (s *GCSObjectClient) DeleteObject(ctx context.Context, objectKey string) error
DeleteObject deletes the specified object key from the configured GCS bucket. If the key does not exist a generic chunk.ErrStorageObjectNotFound error is returned.
func (*GCSObjectClient) GetObject ¶ added in v0.7.0
func (s *GCSObjectClient) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, error)
GetObject returns a reader for the specified object key from the configured GCS bucket. If the key does not exist a generic chunk.ErrStorageObjectNotFound error is returned.
func (*GCSObjectClient) List ¶ added in v0.7.0
func (s *GCSObjectClient) List(ctx context.Context, prefix string) ([]chunk.StorageObject, error)
List only objects from the store non-recursively