Documentation ¶
Index ¶
- Constants
- Variables
- func ToPbCreateTableRequest(in *ProviderCreateAllTablesRequest) *internal.CreateAllTables_Request
- func ToPbDiagnostics(diagnostics *schema.Diagnostics) []*internal.Diagnostic
- func ToPbDropTableRequest(in *ProviderDropTableAllRequest) *internal.DropTableAll_Request
- func ToPbGetProviderConfigRequest(_ *GetProviderConfigRequest) *internal.GetProviderConfig_Request
- func ToPbGetProviderConfigResponse(in *GetProviderConfigResponse) *internal.GetProviderConfig_Response
- func ToPbGetProviderInformationRequest(_ *GetProviderInformationRequest) *internal.GetProviderInformation_Request
- func ToPbGetProviderInformationResponse(in *GetProviderInformationResponse) *internal.GetProviderInformation_Response
- func ToPbGetProviderInitResponse(response *ProviderInitResponse) *internal.ProviderInit_Response
- func ToPbProviderInitRequest(request *ProviderInitRequest) *internal.ProviderInit_Request
- func ToPbPullTablesRequest(in *PullTablesRequest) *internal.PullTables_Request
- func ToPbPullTablesResponse(in *PullTablesResponse) *internal.PullTables_Response
- func ToPbSchemaColumn(column *schema.Column) *internal.Column
- func ToPbSchemaColumns(columns []*schema.Column) []*internal.Column
- func ToPbSchemaTable(table *schema.Table) *internal.Table
- func ToPbSchemaTablesByList(tables []*schema.Table) []*internal.Table
- func ToPbSchemaTablesByMap(tables map[string]*schema.Table) map[string]*internal.Table
- func ToPbSetProviderConfigRequest(in *SetProviderConfigRequest) *internal.SetProviderConfig_Request
- func ToPbSetProviderConfigResponse(in *SetProviderConfigResponse) *internal.SetProviderConfig_Response
- func ToPbStorage(storage *Storage) *internal.Storage
- func ToSchemaColumn(column *internal.Column) *schema.Column
- func ToSchemaColumns(columns []*internal.Column) []*schema.Column
- func ToSchemaTable(table *internal.Table) *schema.Table
- func ToSchemaTablesByList(tables []*internal.Table) []*schema.Table
- func ToSchemaTablesByMap(tables map[string]*internal.Table) map[string]*schema.Table
- func ToShardDiagnostics(pbDiagnosticSlice []*internal.Diagnostic) *schema.Diagnostics
- type FakeProviderServerSender
- type GRPCClient
- func (g *GRPCClient) CreateAllTables(ctx context.Context, in *ProviderCreateAllTablesRequest) (*ProviderCreateAllTablesResponse, error)
- func (g *GRPCClient) DropTableAll(ctx context.Context, in *ProviderDropTableAllRequest) (*ProviderDropTableAllResponse, error)
- func (g *GRPCClient) GetProviderConfig(ctx context.Context, in *GetProviderConfigRequest) (*GetProviderConfigResponse, error)
- func (g *GRPCClient) GetProviderInformation(ctx context.Context, in *GetProviderInformationRequest) (*GetProviderInformationResponse, error)
- func (g *GRPCClient) Init(ctx context.Context, in *ProviderInitRequest) (*ProviderInitResponse, error)
- func (g *GRPCClient) PullTables(ctx context.Context, in *PullTablesRequest) (ProviderServerStream, error)
- func (g *GRPCClient) SetProviderConfig(ctx context.Context, in *SetProviderConfigRequest) (*SetProviderConfigResponse, error)
- type GRPCServer
- func (g *GRPCServer) CreateAllTables(context.Context, *internal.CreateAllTables_Request) (*internal.CreateAllTables_Response, error)
- func (g *GRPCServer) DropTableAll(context.Context, *internal.DropTableAll_Request) (*internal.DropTableAll_Response, error)
- func (g *GRPCServer) GetProviderConfig(ctx context.Context, in *internal.GetProviderConfig_Request) (*internal.GetProviderConfig_Response, error)
- func (g *GRPCServer) GetProviderInformation(ctx context.Context, in *internal.GetProviderInformation_Request) (*internal.GetProviderInformation_Response, error)
- func (g *GRPCServer) Init(ctx context.Context, in *internal.ProviderInit_Request) (*internal.ProviderInit_Response, error)
- func (g *GRPCServer) PullTables(req *internal.PullTables_Request, send internal.Provider_PullTablesServer) error
- func (g *GRPCServer) SetProviderConfig(ctx context.Context, in *internal.SetProviderConfig_Request) (*internal.SetProviderConfig_Response, error)
- type GetProviderConfigRequest
- type GetProviderConfigResponse
- type GetProviderInformationRequest
- type GetProviderInformationResponse
- type Plugin
- type Provider
- type ProviderClient
- type ProviderConfiguration
- type ProviderCreateAllTablesRequest
- type ProviderCreateAllTablesResponse
- type ProviderDropTableAllRequest
- type ProviderDropTableAllResponse
- type ProviderInitRequest
- type ProviderInitResponse
- type ProviderServer
- type ProviderServerSender
- type ProviderServerStream
- type PullTablesRequest
- type PullTablesResponse
- type Recv
- type Send
- type SetProviderConfigRequest
- type SetProviderConfigResponse
- type Storage
- type StorageType
Constants ¶
View Source
const ( V1 = 1 Unmanaged = -1 )
Variables ¶
Functions ¶
func ToPbCreateTableRequest ¶
func ToPbCreateTableRequest(in *ProviderCreateAllTablesRequest) *internal.CreateAllTables_Request
func ToPbDiagnostics ¶
func ToPbDiagnostics(diagnostics *schema.Diagnostics) []*internal.Diagnostic
func ToPbDropTableRequest ¶
func ToPbDropTableRequest(in *ProviderDropTableAllRequest) *internal.DropTableAll_Request
func ToPbGetProviderConfigRequest ¶
func ToPbGetProviderConfigRequest(_ *GetProviderConfigRequest) *internal.GetProviderConfig_Request
func ToPbGetProviderConfigResponse ¶
func ToPbGetProviderConfigResponse(in *GetProviderConfigResponse) *internal.GetProviderConfig_Response
func ToPbGetProviderInformationRequest ¶
func ToPbGetProviderInformationRequest(_ *GetProviderInformationRequest) *internal.GetProviderInformation_Request
func ToPbGetProviderInformationResponse ¶
func ToPbGetProviderInformationResponse(in *GetProviderInformationResponse) *internal.GetProviderInformation_Response
func ToPbGetProviderInitResponse ¶
func ToPbGetProviderInitResponse(response *ProviderInitResponse) *internal.ProviderInit_Response
func ToPbProviderInitRequest ¶
func ToPbProviderInitRequest(request *ProviderInitRequest) *internal.ProviderInit_Request
func ToPbPullTablesRequest ¶
func ToPbPullTablesRequest(in *PullTablesRequest) *internal.PullTables_Request
func ToPbPullTablesResponse ¶
func ToPbPullTablesResponse(in *PullTablesResponse) *internal.PullTables_Response
func ToPbSchemaTablesByMap ¶
func ToPbSetProviderConfigRequest ¶
func ToPbSetProviderConfigRequest(in *SetProviderConfigRequest) *internal.SetProviderConfig_Request
func ToPbSetProviderConfigResponse ¶
func ToPbSetProviderConfigResponse(in *SetProviderConfigResponse) *internal.SetProviderConfig_Response
func ToPbStorage ¶
func ToSchemaTablesByMap ¶
func ToShardDiagnostics ¶
func ToShardDiagnostics(pbDiagnosticSlice []*internal.Diagnostic) *schema.Diagnostics
Types ¶
type FakeProviderServerSender ¶
type FakeProviderServerSender struct {
ProviderServerSender
}
FakeProviderServerSender The Provider simulates RPC calls when doing integration tests
func NewFakeProviderServerSender ¶
func NewFakeProviderServerSender() *FakeProviderServerSender
func (*FakeProviderServerSender) Send ¶
func (f *FakeProviderServerSender) Send(response *PullTablesResponse) error
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func (*GRPCClient) CreateAllTables ¶
func (g *GRPCClient) CreateAllTables(ctx context.Context, in *ProviderCreateAllTablesRequest) (*ProviderCreateAllTablesResponse, error)
func (*GRPCClient) DropTableAll ¶
func (g *GRPCClient) DropTableAll(ctx context.Context, in *ProviderDropTableAllRequest) (*ProviderDropTableAllResponse, error)
func (*GRPCClient) GetProviderConfig ¶
func (g *GRPCClient) GetProviderConfig(ctx context.Context, in *GetProviderConfigRequest) (*GetProviderConfigResponse, error)
func (*GRPCClient) GetProviderInformation ¶
func (g *GRPCClient) GetProviderInformation(ctx context.Context, in *GetProviderInformationRequest) (*GetProviderInformationResponse, error)
func (*GRPCClient) Init ¶
func (g *GRPCClient) Init(ctx context.Context, in *ProviderInitRequest) (*ProviderInitResponse, error)
func (*GRPCClient) PullTables ¶
func (g *GRPCClient) PullTables(ctx context.Context, in *PullTablesRequest) (ProviderServerStream, error)
func (*GRPCClient) SetProviderConfig ¶
func (g *GRPCClient) SetProviderConfig(ctx context.Context, in *SetProviderConfigRequest) (*SetProviderConfigResponse, error)
type GRPCServer ¶
type GRPCServer struct { // This is the real implementation Impl ProviderServer internal.UnimplementedProviderServer }
func (*GRPCServer) CreateAllTables ¶
func (g *GRPCServer) CreateAllTables(context.Context, *internal.CreateAllTables_Request) (*internal.CreateAllTables_Response, error)
func (*GRPCServer) DropTableAll ¶
func (g *GRPCServer) DropTableAll(context.Context, *internal.DropTableAll_Request) (*internal.DropTableAll_Response, error)
func (*GRPCServer) GetProviderConfig ¶
func (g *GRPCServer) GetProviderConfig(ctx context.Context, in *internal.GetProviderConfig_Request) (*internal.GetProviderConfig_Response, error)
func (*GRPCServer) GetProviderInformation ¶
func (g *GRPCServer) GetProviderInformation(ctx context.Context, in *internal.GetProviderInformation_Request) (*internal.GetProviderInformation_Response, error)
func (*GRPCServer) Init ¶
func (g *GRPCServer) Init(ctx context.Context, in *internal.ProviderInit_Request) (*internal.ProviderInit_Response, error)
func (*GRPCServer) PullTables ¶
func (g *GRPCServer) PullTables(req *internal.PullTables_Request, send internal.Provider_PullTablesServer) error
func (*GRPCServer) SetProviderConfig ¶
func (g *GRPCServer) SetProviderConfig(ctx context.Context, in *internal.SetProviderConfig_Request) (*internal.SetProviderConfig_Response, error)
type GetProviderConfigRequest ¶
type GetProviderConfigRequest struct{}
func ToShardGetProviderConfigRequest ¶
func ToShardGetProviderConfigRequest(_ *internal.GetProviderConfig_Request) *GetProviderConfigRequest
type GetProviderConfigResponse ¶
type GetProviderConfigResponse struct { Name string `json:"name"` Version string `json:"version"` Config string `json:"config"` Diagnostics *schema.Diagnostics `json:"diagnostics"` }
func ToShardGetProviderConfigResponse ¶
func ToShardGetProviderConfigResponse(in *internal.GetProviderConfig_Response) *GetProviderConfigResponse
type GetProviderInformationRequest ¶
type GetProviderInformationRequest struct{}
func ToShardGetProviderInformationRequest ¶
func ToShardGetProviderInformationRequest(_ *internal.GetProviderInformation_Request) *GetProviderInformationRequest
type GetProviderInformationResponse ¶
type GetProviderInformationResponse struct { Name string `json:"name"` Version string `json:"version"` Tables map[string]*schema.Table `json:"tables"` DefaultConfigTemplate string `json:"default_config_template"` Diagnostics *schema.Diagnostics }
func ToShardGetProviderInformationResponse ¶
func ToShardGetProviderInformationResponse(in *internal.GetProviderInformation_Response) *GetProviderInformationResponse
type Plugin ¶
type Plugin struct { // GRPCPlugin must still implement the Stub interface plugin.Plugin // Concrete implementation, written in Go. This is only used for plugins // that are written in Go. Impl ProviderServer }
Plugin This is the implementation of plugin.GRPCServer so we can serve/consume this.
func (*Plugin) GRPCClient ¶
func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (any, error)
func (*Plugin) GRPCServer ¶
type Provider ¶
type Provider interface { Init(ctx context.Context, in *ProviderInitRequest) (*ProviderInitResponse, error) GetProviderInformation(ctx context.Context, in *GetProviderInformationRequest) (*GetProviderInformationResponse, error) GetProviderConfig(ctx context.Context, in *GetProviderConfigRequest) (*GetProviderConfigResponse, error) SetProviderConfig(ctx context.Context, in *SetProviderConfigRequest) (*SetProviderConfigResponse, error) DropTableAll(ctx context.Context, in *ProviderDropTableAllRequest) (*ProviderDropTableAllResponse, error) CreateAllTables(ctx context.Context, in *ProviderCreateAllTablesRequest) (*ProviderCreateAllTablesResponse, error) }
type ProviderClient ¶
type ProviderClient interface { Provider PullTables(ctx context.Context, in *PullTablesRequest) (ProviderServerStream, error) }
type ProviderConfiguration ¶
type ProviderConfiguration struct { Storage Storage `json:"storage"` NamespaceSuffix string `json:"namespace_suffix"` }
ProviderConfiguration Provider General configuration
type ProviderCreateAllTablesRequest ¶
type ProviderCreateAllTablesRequest struct{}
type ProviderCreateAllTablesResponse ¶
type ProviderCreateAllTablesResponse struct {
Diagnostics *schema.Diagnostics `json:"diagnostics"`
}
func ToShardProviderCreateResponse ¶
func ToShardProviderCreateResponse(response *internal.CreateAllTables_Response) *ProviderCreateAllTablesResponse
type ProviderDropTableAllRequest ¶
type ProviderDropTableAllRequest struct{}
type ProviderDropTableAllResponse ¶
type ProviderDropTableAllResponse struct {
Diagnostics *schema.Diagnostics `json:"diagnostics"`
}
func ToShardProviderDropResponse ¶
func ToShardProviderDropResponse(response *internal.DropTableAll_Response) *ProviderDropTableAllResponse
type ProviderInitRequest ¶
type ProviderInitRequest struct { Storage *Storage Workspace *string ProviderConfig *string IsInstallInit *bool }
func ToShardProviderInitRequest ¶
func ToShardProviderInitRequest(request *internal.ProviderInit_Request) *ProviderInitRequest
type ProviderInitResponse ¶
type ProviderInitResponse struct {
Diagnostics *schema.Diagnostics `json:"diagnostics"`
}
func ToShardProviderInitResponse ¶
func ToShardProviderInitResponse(response *internal.ProviderInit_Response) *ProviderInitResponse
type ProviderServer ¶
type ProviderServer interface { Provider PullTables(context.Context, *PullTablesRequest, ProviderServerSender) error }
type ProviderServerSender ¶
type ProviderServerSender interface {
Send(*PullTablesResponse) error
}
type ProviderServerStream ¶
type ProviderServerStream interface {
Recv() (*PullTablesResponse, error)
}
type PullTablesRequest ¶
type PullTablesRequest struct { // The table to be pulled, this later expands to support parameters Tables []string `json:"tables"` // Maximum number of threads used MaxGoroutines uint64 `json:"max_goroutines"` // Pull timeout period Timeout int64 `json:"timeout"` }
func NewPullAllTablesRequest ¶
func NewPullAllTablesRequest() *PullTablesRequest
NewPullAllTablesRequest The Provider integration test simulates the RPC environment
func ToShardPullTablesRequest ¶
func ToShardPullTablesRequest(in *internal.PullTables_Request) *PullTablesRequest
type PullTablesResponse ¶
type PullTablesResponse struct { FinishedTables map[string]bool `json:"finished_tables"` TableCount uint64 `json:"table_count"` Table string `json:"table"` Diagnostics *schema.Diagnostics `json:"diagnostic"` }
func ToShardPullTablesResponse ¶
func ToShardPullTablesResponse(in *internal.PullTables_Response) *PullTablesResponse
type Recv ¶
type Recv struct {
// contains filtered or unexported fields
}
func (*Recv) Recv ¶
func (t *Recv) Recv() (*PullTablesResponse, error)
type Send ¶
type Send struct {
// contains filtered or unexported fields
}
func (*Send) Send ¶
func (s *Send) Send(p *PullTablesResponse) error
type SetProviderConfigRequest ¶
type SetProviderConfigRequest struct { Storage *Storage `json:"storage"` ProviderConfig *string `json:"provider_config"` }
func ToShardSetProviderConfigurationRequest ¶
func ToShardSetProviderConfigurationRequest(in *internal.SetProviderConfig_Request) *SetProviderConfigRequest
type SetProviderConfigResponse ¶
type SetProviderConfigResponse struct {
Diagnostics *schema.Diagnostics `json:"diagnostics"`
}
func ToShardSetProviderConfigResponse ¶
func ToShardSetProviderConfigResponse(in *internal.SetProviderConfig_Response) *SetProviderConfigResponse
type Storage ¶
type Storage struct { Type StorageType `json:"type"` StorageOptions []byte `json:"options"` }
func ToShardStorage ¶
func (*Storage) GetStorageOptions ¶
func (x *Storage) GetStorageOptions() storage.CreateStorageOptions
func (*Storage) GetStorageType ¶
func (x *Storage) GetStorageType() storage_factory.StorageType
Click to show internal directories.
Click to hide internal directories.