Documentation
¶
Index ¶
- Constants
- Variables
- type API
- type ConfigProvider
- type Handler
- func (h *Handler) API() *API
- func (h *Handler) Addr() string
- func (h *Handler) ExtractOperation(*echo.Context) string
- func (h *Handler) ExtractResource(*echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Shutdown(ctx context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- type InMemoryBackend
- func (b *InMemoryBackend) CheckAndMutateRow(req *btpb.CheckAndMutateRowRequest) (*btpb.CheckAndMutateRowResponse, error)
- func (b *InMemoryBackend) CheckConsistency(in *adminpb.CheckConsistencyRequest) (*adminpb.CheckConsistencyResponse, error)
- func (b *InMemoryBackend) CreateAppProfile(in *adminpb.CreateAppProfileRequest) (*adminpb.AppProfile, error)
- func (b *InMemoryBackend) CreateBackup(in *adminpb.CreateBackupRequest) (*longrunningpb.Operation, error)
- func (b *InMemoryBackend) CreateCluster(in *adminpb.CreateClusterRequest) (*longrunningpb.Operation, error)
- func (b *InMemoryBackend) CreateInstance(in *adminpb.CreateInstanceRequest) (*longrunningpb.Operation, error)
- func (b *InMemoryBackend) CreateTable(in *adminpb.CreateTableRequest) (*adminpb.Table, error)
- func (b *InMemoryBackend) DeleteAppProfile(in *adminpb.DeleteAppProfileRequest) (*emptypb.Empty, error)
- func (b *InMemoryBackend) DeleteBackup(name string) (*emptypb.Empty, error)
- func (b *InMemoryBackend) DeleteCluster(name string) (*emptypb.Empty, error)
- func (b *InMemoryBackend) DeleteInstance(name string) (*emptypb.Empty, error)
- func (b *InMemoryBackend) DeleteTable(name string) (*emptypb.Empty, error)
- func (b *InMemoryBackend) DropRowRange(in *adminpb.DropRowRangeRequest) (*emptypb.Empty, error)
- func (b *InMemoryBackend) GenerateConsistencyToken(in *adminpb.GenerateConsistencyTokenRequest) (*adminpb.GenerateConsistencyTokenResponse, error)
- func (b *InMemoryBackend) GetAppProfile(name string) (*adminpb.AppProfile, error)
- func (b *InMemoryBackend) GetBackup(name string) (*adminpb.Backup, error)
- func (b *InMemoryBackend) GetCluster(name string) (*adminpb.Cluster, error)
- func (b *InMemoryBackend) GetIamPolicy(resource string, version int32) (*iampb.Policy, error)
- func (b *InMemoryBackend) GetInstance(name string) (*adminpb.Instance, error)
- func (b *InMemoryBackend) GetTable(in *adminpb.GetTableRequest) (*adminpb.Table, error)
- func (b *InMemoryBackend) ListAppProfiles(in *adminpb.ListAppProfilesRequest) (*adminpb.ListAppProfilesResponse, error)
- func (b *InMemoryBackend) ListBackups(in *adminpb.ListBackupsRequest) (*adminpb.ListBackupsResponse, error)
- func (b *InMemoryBackend) ListClusters(in *adminpb.ListClustersRequest) (*adminpb.ListClustersResponse, error)
- func (b *InMemoryBackend) ListInstances(in *adminpb.ListInstancesRequest) (*adminpb.ListInstancesResponse, error)
- func (b *InMemoryBackend) ListTables(in *adminpb.ListTablesRequest) (*adminpb.ListTablesResponse, error)
- func (b *InMemoryBackend) ModifyColumnFamilies(in *adminpb.ModifyColumnFamiliesRequest) (*adminpb.Table, error)
- func (b *InMemoryBackend) MutateRow(req *btpb.MutateRowRequest) (*btpb.MutateRowResponse, error)
- func (b *InMemoryBackend) MutateRows(req *btpb.MutateRowsRequest) ([]*btpb.MutateRowsResponse_Entry, error)
- func (b *InMemoryBackend) PartialUpdateCluster(in *adminpb.PartialUpdateClusterRequest) (*longrunningpb.Operation, error)
- func (b *InMemoryBackend) PartialUpdateInstance(in *adminpb.PartialUpdateInstanceRequest) (*longrunningpb.Operation, error)
- func (b *InMemoryBackend) PingAndWarm(req *btpb.PingAndWarmRequest) error
- func (b *InMemoryBackend) ReadModifyWriteRow(req *btpb.ReadModifyWriteRowRequest) (*btpb.ReadModifyWriteRowResponse, error)
- func (b *InMemoryBackend) ReadRows(req *btpb.ReadRowsRequest) (*ReadResult, error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RestoreTable(in *adminpb.RestoreTableRequest) (*longrunningpb.Operation, error)
- func (b *InMemoryBackend) SampleRowKeys(req *btpb.SampleRowKeysRequest) ([]*btpb.SampleRowKeysResponse, error)
- func (b *InMemoryBackend) SetIamPolicy(in *iampb.SetIamPolicyRequest) (*iampb.Policy, error)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TestIamPermissions(in *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error)
- func (b *InMemoryBackend) UpdateAppProfile(in *adminpb.UpdateAppProfileRequest) (*longrunningpb.Operation, error)
- func (b *InMemoryBackend) UpdateBackup(in *adminpb.UpdateBackupRequest) (*adminpb.Backup, error)
- func (b *InMemoryBackend) UpdateCluster(in *adminpb.Cluster) (*longrunningpb.Operation, error)
- func (b *InMemoryBackend) UpdateInstance(in *adminpb.Instance) (*adminpb.Instance, error)
- func (b *InMemoryBackend) UpdateTable(in *adminpb.UpdateTableRequest) (*longrunningpb.Operation, error)
- type Provider
- type ReadResult
- type ResultRow
- type Settings
Constants ¶
const DefaultPort = 8137
DefaultPort is the dedicated gRPC and REST listener's default TCP port.
Variables ¶
var ErrNilAppContext = errors.New("gcpbigtable: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Instances adminpb.BigtableInstanceAdminServer
Tables adminpb.BigtableTableAdminServer
// contains filtered or unexported fields
}
API groups the Bigtable services for in-process callers (dashboard proxy).
type ConfigProvider ¶
type ConfigProvider interface {
GetGCPBigtableSettings() Settings
}
ConfigProvider extracts Bigtable configuration from the AppContext Config.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
Port int
// contains filtered or unexported fields
}
Handler serves the Cloud Bigtable admin and data APIs on a dedicated gRPC and REST listener.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a Handler; callers override Port from Settings.
func (*Handler) ExtractOperation ¶
ExtractOperation is unused: requests never reach the shared router.
func (*Handler) ExtractResource ¶
ExtractResource is unused: requests never reach the shared router.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists the supported gRPC methods.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns a 404 handler; the real API is on the dedicated port.
func (*Handler) MatchPriority ¶
MatchPriority is irrelevant because RouteMatcher never matches.
func (*Handler) RouteMatcher ¶
RouteMatcher never matches: Cloud Bigtable runs on its own listener.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend holds all Cloud Bigtable state under one lock.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) CheckAndMutateRow ¶
func (b *InMemoryBackend) CheckAndMutateRow( req *btpb.CheckAndMutateRowRequest, ) (*btpb.CheckAndMutateRowResponse, error)
CheckAndMutateRow applies one of two mutation lists depending on whether the predicate matches the row.
func (*InMemoryBackend) CheckConsistency ¶
func (b *InMemoryBackend) CheckConsistency( in *adminpb.CheckConsistencyRequest, ) (*adminpb.CheckConsistencyResponse, error)
CheckConsistency reports whether all writes before the token reached every cluster; replication is synchronous here.
func (*InMemoryBackend) CreateAppProfile ¶
func (b *InMemoryBackend) CreateAppProfile(in *adminpb.CreateAppProfileRequest) (*adminpb.AppProfile, error)
CreateAppProfile creates an app profile.
func (*InMemoryBackend) CreateBackup ¶
func (b *InMemoryBackend) CreateBackup(in *adminpb.CreateBackupRequest) (*longrunningpb.Operation, error)
CreateBackup snapshots a table into a backup stored in a cluster.
func (*InMemoryBackend) CreateCluster ¶
func (b *InMemoryBackend) CreateCluster(in *adminpb.CreateClusterRequest) (*longrunningpb.Operation, error)
CreateCluster adds a cluster to an instance.
func (*InMemoryBackend) CreateInstance ¶
func (b *InMemoryBackend) CreateInstance(in *adminpb.CreateInstanceRequest) (*longrunningpb.Operation, error)
CreateInstance creates an instance with its clusters.
func (*InMemoryBackend) CreateTable ¶
func (b *InMemoryBackend) CreateTable(in *adminpb.CreateTableRequest) (*adminpb.Table, error)
CreateTable creates a table with its column families and split points.
func (*InMemoryBackend) DeleteAppProfile ¶
func (b *InMemoryBackend) DeleteAppProfile(in *adminpb.DeleteAppProfileRequest) (*emptypb.Empty, error)
DeleteAppProfile deletes an app profile.
func (*InMemoryBackend) DeleteBackup ¶
func (b *InMemoryBackend) DeleteBackup(name string) (*emptypb.Empty, error)
DeleteBackup deletes a backup.
func (*InMemoryBackend) DeleteCluster ¶
func (b *InMemoryBackend) DeleteCluster(name string) (*emptypb.Empty, error)
DeleteCluster deletes a cluster and its backups; the last cluster of an instance cannot be deleted.
func (*InMemoryBackend) DeleteInstance ¶
func (b *InMemoryBackend) DeleteInstance(name string) (*emptypb.Empty, error)
DeleteInstance deletes an instance and everything in it.
func (*InMemoryBackend) DeleteTable ¶
func (b *InMemoryBackend) DeleteTable(name string) (*emptypb.Empty, error)
DeleteTable deletes a table unless it is protected.
func (*InMemoryBackend) DropRowRange ¶
func (b *InMemoryBackend) DropRowRange(in *adminpb.DropRowRangeRequest) (*emptypb.Empty, error)
DropRowRange deletes the rows with a key prefix, or all rows.
func (*InMemoryBackend) GenerateConsistencyToken ¶
func (b *InMemoryBackend) GenerateConsistencyToken( in *adminpb.GenerateConsistencyTokenRequest, ) (*adminpb.GenerateConsistencyTokenResponse, error)
GenerateConsistencyToken issues a token for CheckConsistency.
func (*InMemoryBackend) GetAppProfile ¶
func (b *InMemoryBackend) GetAppProfile(name string) (*adminpb.AppProfile, error)
GetAppProfile returns an app profile.
func (*InMemoryBackend) GetBackup ¶
func (b *InMemoryBackend) GetBackup(name string) (*adminpb.Backup, error)
GetBackup returns a backup.
func (*InMemoryBackend) GetCluster ¶
func (b *InMemoryBackend) GetCluster(name string) (*adminpb.Cluster, error)
GetCluster returns a cluster.
func (*InMemoryBackend) GetIamPolicy ¶
GetIamPolicy returns the policy of an instance, table or backup at the requested version.
func (*InMemoryBackend) GetInstance ¶
func (b *InMemoryBackend) GetInstance(name string) (*adminpb.Instance, error)
GetInstance returns an instance.
func (*InMemoryBackend) GetTable ¶
func (b *InMemoryBackend) GetTable(in *adminpb.GetTableRequest) (*adminpb.Table, error)
GetTable returns a table in the requested view (SCHEMA_VIEW by default).
func (*InMemoryBackend) ListAppProfiles ¶
func (b *InMemoryBackend) ListAppProfiles( in *adminpb.ListAppProfilesRequest, ) (*adminpb.ListAppProfilesResponse, error)
ListAppProfiles lists the app profiles of an instance.
func (*InMemoryBackend) ListBackups ¶
func (b *InMemoryBackend) ListBackups(in *adminpb.ListBackupsRequest) (*adminpb.ListBackupsResponse, error)
ListBackups lists the backups of a cluster, or of every cluster of an instance when the cluster is "-".
func (*InMemoryBackend) ListClusters ¶
func (b *InMemoryBackend) ListClusters(in *adminpb.ListClustersRequest) (*adminpb.ListClustersResponse, error)
ListClusters lists the clusters of an instance, or of every instance in a project when the instance is "-".
func (*InMemoryBackend) ListInstances ¶
func (b *InMemoryBackend) ListInstances(in *adminpb.ListInstancesRequest) (*adminpb.ListInstancesResponse, error)
ListInstances lists the instances of a project.
func (*InMemoryBackend) ListTables ¶
func (b *InMemoryBackend) ListTables(in *adminpb.ListTablesRequest) (*adminpb.ListTablesResponse, error)
ListTables lists the tables of an instance (NAME_ONLY by default).
func (*InMemoryBackend) ModifyColumnFamilies ¶
func (b *InMemoryBackend) ModifyColumnFamilies(in *adminpb.ModifyColumnFamiliesRequest) (*adminpb.Table, error)
ModifyColumnFamilies creates, updates and drops column families atomically.
func (*InMemoryBackend) MutateRow ¶
func (b *InMemoryBackend) MutateRow(req *btpb.MutateRowRequest) (*btpb.MutateRowResponse, error)
MutateRow atomically applies mutations to one row.
func (*InMemoryBackend) MutateRows ¶
func (b *InMemoryBackend) MutateRows(req *btpb.MutateRowsRequest) ([]*btpb.MutateRowsResponse_Entry, error)
MutateRows applies each entry atomically and independently; the result holds one status per entry.
func (*InMemoryBackend) PartialUpdateCluster ¶
func (b *InMemoryBackend) PartialUpdateCluster( in *adminpb.PartialUpdateClusterRequest, ) (*longrunningpb.Operation, error)
PartialUpdateCluster updates the masked fields of a cluster.
func (*InMemoryBackend) PartialUpdateInstance ¶
func (b *InMemoryBackend) PartialUpdateInstance( in *adminpb.PartialUpdateInstanceRequest, ) (*longrunningpb.Operation, error)
PartialUpdateInstance updates the masked fields of an instance.
func (*InMemoryBackend) PingAndWarm ¶
func (b *InMemoryBackend) PingAndWarm(req *btpb.PingAndWarmRequest) error
PingAndWarm checks that the instance exists.
func (*InMemoryBackend) ReadModifyWriteRow ¶
func (b *InMemoryBackend) ReadModifyWriteRow( req *btpb.ReadModifyWriteRowRequest, ) (*btpb.ReadModifyWriteRowResponse, error)
ReadModifyWriteRow applies append and increment rules to a row and returns the cells it wrote.
func (*InMemoryBackend) ReadRows ¶
func (b *InMemoryBackend) ReadRows(req *btpb.ReadRowsRequest) (*ReadResult, error)
ReadRows evaluates a read: row selection, filter, reversal and the row limit.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads a snapshot, replacing all state.
func (*InMemoryBackend) RestoreTable ¶
func (b *InMemoryBackend) RestoreTable(in *adminpb.RestoreTableRequest) (*longrunningpb.Operation, error)
RestoreTable creates a new table from a backup.
func (*InMemoryBackend) SampleRowKeys ¶
func (b *InMemoryBackend) SampleRowKeys(req *btpb.SampleRowKeysRequest) ([]*btpb.SampleRowKeysResponse, error)
SampleRowKeys returns approximate split points with the cumulative size of the rows before each.
func (*InMemoryBackend) SetIamPolicy ¶
func (b *InMemoryBackend) SetIamPolicy(in *iampb.SetIamPolicyRequest) (*iampb.Policy, error)
SetIamPolicy replaces a policy; a stale etag aborts the call.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises every instance with its clusters, profiles, tables, rows, backups and operations.
func (*InMemoryBackend) TestIamPermissions ¶
func (b *InMemoryBackend) TestIamPermissions( in *iampb.TestIamPermissionsRequest, ) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions reports the requested Bigtable permissions as granted: the emulator authorises all callers.
func (*InMemoryBackend) UpdateAppProfile ¶
func (b *InMemoryBackend) UpdateAppProfile(in *adminpb.UpdateAppProfileRequest) (*longrunningpb.Operation, error)
UpdateAppProfile updates the masked fields of an app profile; an empty mask replaces every field.
func (*InMemoryBackend) UpdateBackup ¶
func (b *InMemoryBackend) UpdateBackup(in *adminpb.UpdateBackupRequest) (*adminpb.Backup, error)
UpdateBackup changes a backup's expiry.
func (*InMemoryBackend) UpdateCluster ¶
func (b *InMemoryBackend) UpdateCluster(in *adminpb.Cluster) (*longrunningpb.Operation, error)
UpdateCluster changes the serve_nodes of a cluster.
func (*InMemoryBackend) UpdateInstance ¶
UpdateInstance replaces an instance's display name and type.
func (*InMemoryBackend) UpdateTable ¶
func (b *InMemoryBackend) UpdateTable(in *adminpb.UpdateTableRequest) (*longrunningpb.Operation, error)
UpdateTable updates the masked table-level settings.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for Google Cloud Bigtable. It serves gRPC and REST on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init creates the backend and handler; the port is bound in StartWorker.
type ReadResult ¶
type ReadResult struct {
Stats *btpb.ReadIterationStats
Rows []*ResultRow
}
ReadResult is the outcome of one ReadRows call.
type ResultRow ¶
type ResultRow struct {
Key string
Cells []fcell
}
ResultRow is one scanned row; a row the filter emptied has no cells.
type Settings ¶
type Settings struct {
Port int `` //nolint:lll // config struct tags are intentionally verbose
/* 209-byte string literal not displayed */
}
Settings holds service-level configuration, embedded in the root CLI command as CLI.GCPBigtable.
func DefaultSettings ¶
func DefaultSettings() Settings
DefaultSettings returns the settings used when no ConfigProvider is available.