Documentation
¶
Index ¶
- Variables
- func ConnectionTestDiagnostic(err error) string
- func ExecuteSchemaIntrospection(ctx context.Context, factory connector.NewConnectorFunc, ...) ([]byte, error)
- func SchemaTypeStrings() []string
- type ConnectionTestExecutor
- type ConnectionTestRequest
- type CreateParams
- type CustomerConfigPolicy
- type DataSource
- type DataSourceBranch
- type DocumentSchemaPayload
- type FileSchemaPayload
- type GitBranchExecutor
- type GitBranchRequest
- type GitDataSourceAuth
- type GitExecutionAuth
- type GitHubAppManager
- type GitHubProposalAuthority
- type GitLabWebhookManager
- type HTTPOAuthConnection
- type HTTPSchemaPayload
- type ObjectAPISchemaPayload
- type ProviderDataSourceInstall
- type ProviderRepository
- type QueuedSchemaImportJob
- type SQLSchemaPayload
- type Schema
- type SchemaCollection
- type SchemaColumn
- type SchemaField
- type SchemaFile
- type SchemaFileDiagnostic
- type SchemaImportDiagnostic
- type SchemaImportResult
- type SchemaIntrospectionExecutor
- type SchemaIntrospectionRequest
- type SchemaObjectAPIField
- type SchemaObjectAPIObject
- type SchemaObjectAPIOperation
- type SchemaOperation
- type SchemaResult
- type SchemaTable
- type SchemaType
- type SelectProviderRepositoryParams
- type Service
- type ServiceConfig
- type ServiceWithLogging
- func (_d ServiceWithLogging) AttachOrganizationGitLabConnection(ctx context.Context, s1 slug.Slug, s2 slug.Slug, e1 model.EventActor) (err error)
- func (_d ServiceWithLogging) CompleteProviderOAuthCallback(ctx context.Context, params credentialssvc.CompleteOAuthCallbackParams) (c2 credentialssvc.CompleteOAuthCallbackResult, err error)
- func (_d ServiceWithLogging) ConnectHTTPOAuth(ctx context.Context, s1 slug.Slug, s2 slug.Slug, e1 model.EventActor) (hp1 *HTTPOAuthConnection, err error)
- func (_d ServiceWithLogging) Create(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, ...) (dp1 *DataSource, err error)
- func (_d ServiceWithLogging) CreateProvisioned(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, ...) (dp1 *DataSource, err error)
- func (_d ServiceWithLogging) Delete(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (err error)
- func (_d ServiceWithLogging) EnsureProofWebhook(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (err error)
- func (_d ServiceWithLogging) ExecuteQueuedSchemaImport(ctx context.Context, args jobs.DataSourceSchemaImportArgs) (sp1 *SchemaImportResult, err error)
- func (_d ServiceWithLogging) FindBySlug(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (dp1 *DataSource, err error)
- func (_d ServiceWithLogging) GetGoogleWorkspaceFile(ctx context.Context, s1 slug.Slug, s2 slug.Slug, s3 string) (fp1 *workspace.File, err error)
- func (_d ServiceWithLogging) GetGoogleWorkspacePicker(ctx context.Context, s1 slug.Slug, s2 slug.Slug) (wp1 *WorkspacePicker, err error)
- func (_d ServiceWithLogging) GetGoogleWorkspaceWorksheets(ctx context.Context, s1 slug.Slug, s2 slug.Slug, s3 string) (mp1 *workspace.Metadata, err error)
- func (_d ServiceWithLogging) GetSnowflakeOnboarding(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (sp1 *SnowflakeOnboarding, err error)
- func (_d ServiceWithLogging) IntrospectSchema(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (s1 SchemaResult, err error)
- func (_d ServiceWithLogging) ListBranches(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (da1 []DataSourceBranch, err error)
- func (_d ServiceWithLogging) ListByOrg(ctx context.Context, orgSlug slug.Slug, req model.ListRequest) (p1 model.ListResponse[DataSource], err error)
- func (_d ServiceWithLogging) ListGoogleWorkspaceFiles(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (dp1 *workspace.Discovery, err error)
- func (_d ServiceWithLogging) ListProviderRepositories(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (pa1 []ProviderRepository, err error)
- func (_d ServiceWithLogging) RecordCredentialLifecycleEvent(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (err error)
- func (_d ServiceWithLogging) RefreshSchema(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (sp1 *SchemaImportResult, err error)
- func (_d ServiceWithLogging) ResolveGitAuth(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (gp1 *GitDataSourceAuth, err error)
- func (_d ServiceWithLogging) ResolveGitExecutionAuth(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (gp1 *GitExecutionAuth, err error)
- func (_d ServiceWithLogging) Restore(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (err error)
- func (_d ServiceWithLogging) SelectProviderRepository(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (dp1 *DataSource, err error)
- func (_d ServiceWithLogging) StartProviderDataSourceInstall(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, ...) (pp1 *ProviderDataSourceInstall, err error)
- func (_d ServiceWithLogging) TestConnection(ctx context.Context, orgSlug slug.Slug, params *TestConnectionParams) (err error)
- func (_d ServiceWithLogging) TestExistingConnection(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (err error)
- func (_d ServiceWithLogging) Update(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (dp1 *DataSource, err error)
- func (_d ServiceWithLogging) UpdateCredentials(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (dp1 *DataSource, err error)
- func (_d ServiceWithLogging) ValidateCredentialLifecycle(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, ...) (dp1 *DataSource, err error)
- func (_d ServiceWithLogging) VerifyGoogleWorkspaceFiles(ctx context.Context, s1 slug.Slug, s2 slug.Slug, e1 model.EventActor, ...) (dp1 *workspace.Discovery, err error)
- type SnowflakeOnboarding
- type SourceProvisioner
- type SpreadsheetSchemaPayload
- type StartProviderDataSourceInstallParams
- type TestConnectionParams
- type UpdateCredentialsParams
- type UpdateParams
- type WorkspacePicker
- type WorkspacePickerSettings
- type WorkspaceVerificationParams
Constants ¶
This section is empty.
Variables ¶
var ( ErrDataSourceNotFound = repods.ErrDataSourceNotFound ErrDataSourceUsedAsProjectBackend = repods.ErrDataSourceUsedAsProjectBackend ErrConnectionTestConflict = repods.ErrConnectionTestConflict ErrSlugTaken = repods.ErrSlugTaken )
Re-exported from repository layer — single source of truth.
var ( ErrInvalidInput = xerror.ValidationFailed() ErrInvalidDataSourceType = xerror.InvalidInput(xerror.DataSource) ErrConnectionFailed = xerror.ConnectionFailed(xerror.DataSource) ErrSchemaIntrospectionUnsupported = xerror.DataSourceSchemaIntrospectionUnsupported() ErrInvalidSchemaURL = xerror.InvalidSchemaURL() ErrSchemaFetchFailed = xerror.SchemaFetchFailed() ErrInvalidOpenAPI = xerror.InvalidOpenAPI() ErrDataSourceReadOnly = xerror.DataSourceReadOnly() )
Service-only errors.
Functions ¶
func ConnectionTestDiagnostic ¶
ConnectionTestDiagnostic crosses the worker boundary without exposing provider error text.
func ExecuteSchemaIntrospection ¶
func ExecuteSchemaIntrospection( ctx context.Context, factory connector.NewConnectorFunc, request SchemaIntrospectionRequest, ) ([]byte, error)
ExecuteSchemaIntrospection performs one live schema read. It is exported so the isolated executor can own the connector while control-plane services keep persistence and orchestration ownership.
func SchemaTypeStrings ¶
func SchemaTypeStrings() []string
SchemaTypeStrings returns a slice of all String values of the enum
Types ¶
type ConnectionTestExecutor ¶
type ConnectionTestExecutor interface {
TestConnection(context.Context, ConnectionTestRequest) error
}
ConnectionTestExecutor crosses the connector-capable execution boundary. Admission rejections must be marked with executiondelivery.MarkNotExecuted.
type ConnectionTestRequest ¶
type ConnectionTestRequest struct {
OrganizationSlug slug.Slug `json:"organization_slug"`
DataSourceSlug slug.Slug `json:"data_source_slug"`
DataSourceType model.DataSourceType `json:"data_source_type"`
ConfigJSON []byte `json:"config_json"`
CredentialsJSON []byte `json:"credentials_json"`
}
ConnectionTestRequest is the complete worker-side connector test payload. Remote implementations must encrypt it before persistence.
type CreateParams ¶
type CreateParams struct {
Name string `validate:"required,min=1,max=100"`
Slug slug.Slug // Empty slug will be generated from name
Type model.DataSourceType `validate:"required,datasourcetype"`
ConfigJSON json.RawMessage `validate:"required"`
Credentials map[string]any
ReadOnly bool
}
CreateParams are the parameters for creating a new data source.
type CustomerConfigPolicy ¶
CustomerConfigPolicy controls which customer-supplied data source config options are accepted.
type DataSource ¶
type DataSource struct {
ConnectionRevision int64
OrganizationGitLabConnection bool
Slug slug.Slug
Name string
Type model.DataSourceType
Config json.RawMessage
Schema SchemaResult
SchemaCached bool
SchemaImportStatus model.DataSourceSchemaImportStatus
SchemaImportDiagnostic *SchemaImportDiagnostic
SchemaImportStartedAt *time.Time
SchemaImportFinishedAt *time.Time
EncryptedCredentials []byte
Credential *credentialssvc.CredentialMetadata
IsActive bool
ReadOnly bool
LastTestedAt *time.Time
TestError *string
CreatedAt time.Time
UpdatedAt time.Time
}
DataSource represents a data source in the domain model (service layer).
type DataSourceBranch ¶
DataSourceBranch describes a remote branch visible through a git-compatible data source.
func ExecuteGitBranchList ¶
func ExecuteGitBranchList(ctx context.Context, request GitBranchRequest) ([]DataSourceBranch, error)
type DocumentSchemaPayload ¶
type DocumentSchemaPayload struct {
Collections []SchemaCollection `json:"collections"`
}
type FileSchemaPayload ¶
type FileSchemaPayload struct {
Files []SchemaFile `json:"files"`
Diagnostics []SchemaFileDiagnostic `json:"diagnostics,omitempty"`
}
type GitBranchExecutor ¶
type GitBranchExecutor interface {
ListGitBranches(context.Context, GitBranchRequest) ([]DataSourceBranch, error)
}
type GitBranchRequest ¶
type GitBranchRequest struct {
OrganizationSlug slug.Slug `json:"organization_slug"`
Auth GitExecutionAuth `json:"auth"`
MaxResultBytes int `json:"max_result_bytes"`
MaxResultItems int `json:"max_result_items"`
}
type GitDataSourceAuth ¶
type GitDataSourceAuth struct {
GitConfigurationHash string
GitWritable bool
GitDataSourceSlug string
GitCredentialSlug string
GitCredentialRevision string
// Provider selects native PR/MR publication or plain Git proposal branches.
Provider string
// Env holds auth variables created from decrypted datasource credentials.
// Provider HTTPS PATs are exposed here as GITHUB_TOKEN or GITLAB_TOKEN so
// git operations and provider API calls can share the same resolved secret
// without embedding it in RepoURL.
Env []string
// RepoURL is a sanitized repository URL whose native Git transport is pinned
// through Env to the destination vetted by the data-source host policy.
RepoURL string
// DefaultBranch is the branch configured on the data source, may be empty.
DefaultBranch string
// GitHubContentsPermission is set only from a freshly minted GitHub App installation token.
GitHubContentsPermission *string
GitHubProposalAuthority *GitHubProposalAuthority
// Cleanup removes any temporary files created for this auth session (e.g. SSH key).
Cleanup func()
}
GitDataSourceAuth carries the git authentication components needed for performing raw git operations (CheckRemote, CloneRemote, PushRemote). Cleanup must be called (via defer) when git operations are complete.
func PrepareGitExecutionAuth ¶
func PrepareGitExecutionAuth( ctx context.Context, request GitExecutionAuth, ) (*GitDataSourceAuth, error)
PrepareGitExecutionAuth constructs ephemeral Git credentials and pins the destination on the executor immediately before the network operation.
type GitExecutionAuth ¶
type GitExecutionAuth struct {
GitConfigurationHash string `json:"git_configuration_hash,omitempty"`
GitWritable bool `json:"git_writable"`
GitDataSourceSlug string `json:"git_data_source_slug,omitempty"`
GitCredentialSlug string `json:"git_credential_slug,omitempty"`
GitCredentialRevision string `json:"git_credential_revision,omitempty"`
CredentialReference string `json:"credential_reference"`
DataSourceType model.DataSourceType `json:"data_source_type"`
ConfigJSON []byte `json:"config_json"`
CredentialsJSON []byte `json:"credentials_json"`
GitHubContentsPermission *string `json:"github_contents_permission,omitempty"`
GitHubProposalAuthority *GitHubProposalAuthority `json:"github_proposal_authority,omitempty"`
}
GitExecutionAuth carries encrypted-boundary inputs needed to construct Git authentication and destination pinning on the host that performs the dial.
type GitHubAppManager ¶
type GitHubAppManager interface {
Get(context.Context, slug.Slug) (*githubappsvc.Connection, error)
Token(context.Context, slug.Slug, []int64) (githubappsvc.InstallationToken, error)
}
func NewNoopGitHubAppManager ¶
func NewNoopGitHubAppManager() GitHubAppManager
type GitHubProposalAuthority ¶
type GitHubProposalAuthority struct {
CredentialSlug slug.Slug `json:"credential_slug"`
Authority model.PipelineProposalAuthority `json:"authority"`
}
GitHubProposalAuthority contains only verified, credential-safe binding metadata.
type GitLabWebhookManager ¶
type GitLabWebhookManager interface {
Ensure(context.Context, slug.Slug, slug.Slug, []byte, []byte) error
}
func NewNoopGitLabWebhookManager ¶
func NewNoopGitLabWebhookManager() GitLabWebhookManager
type HTTPOAuthConnection ¶
type HTTPOAuthConnection struct {
DataSource *DataSource
Install *credentialssvc.ProviderConnectorInstall
}
HTTPOAuthConnection returns consent metadata only when a browser round trip is required.
type HTTPSchemaPayload ¶
type HTTPSchemaPayload struct {
Operations []SchemaOperation `json:"operations"`
}
type ObjectAPISchemaPayload ¶
type ObjectAPISchemaPayload struct {
Objects []SchemaObjectAPIObject `json:"objects"`
}
type ProviderDataSourceInstall ¶
type ProviderDataSourceInstall struct {
DataSource *DataSource
Install credentialssvc.ProviderConnectorInstall
}
ProviderDataSourceInstall returns the pending source and its provider authorization metadata.
type ProviderRepository ¶
type QueuedSchemaImportJob ¶
QueuedSchemaImportJob reports durable queue acceptance metadata for an import request.
type SQLSchemaPayload ¶
type SQLSchemaPayload struct {
Tables []SchemaTable `json:"tables"`
}
type Schema ¶
type Schema[T any] struct { SchemaTypeValue SchemaType `json:"schema_type"` Type string `json:"type"` Payload T `json:"payload"` }
Schema represents the normalized schema structure stored in cache.
func (Schema[T]) SchemaType ¶
func (s Schema[T]) SchemaType() SchemaType
func (Schema[T]) VendorType ¶
type SchemaCollection ¶
type SchemaCollection struct {
Name string `json:"name"`
Fields []SchemaField `json:"fields"`
}
type SchemaColumn ¶
type SchemaField ¶
type SchemaFile ¶
type SchemaFile struct {
ResourceID string `json:"resource_id,omitempty"`
SizeBytes *int64 `json:"size_bytes,omitempty"`
MIMEType string `json:"mime_type,omitempty"`
Name string `json:"name"`
Fields []SchemaField `json:"fields"`
}
type SchemaFileDiagnostic ¶
type SchemaImportDiagnostic ¶
SchemaImportDiagnostic is safe to expose to operators after a failed import.
type SchemaImportResult ¶
type SchemaImportResult struct {
DataSourceSlug slug.Slug
Status model.DataSourceSchemaImportStatus
Diagnostic *SchemaImportDiagnostic
Skipped bool
StartedAt *time.Time
FinishedAt *time.Time
Enqueued bool
Job *QueuedSchemaImportJob
}
SchemaImportResult reports the durable status after requesting a schema import.
type SchemaIntrospectionExecutor ¶
type SchemaIntrospectionExecutor interface {
IntrospectSchema(context.Context, SchemaIntrospectionRequest) ([]byte, error)
}
SchemaIntrospectionExecutor crosses the connector-capable execution boundary. The result is the normalized schema JSON, rather than a provider object.
type SchemaIntrospectionRequest ¶
type SchemaIntrospectionRequest struct {
OrganizationSlug slug.Slug `json:"organization_slug"`
DataSourceSlug slug.Slug `json:"data_source_slug"`
DataSourceType model.DataSourceType `json:"data_source_type"`
ConfigJSON []byte `json:"config_json"`
CredentialsJSON []byte `json:"credentials_json"`
MaxResultBytes int `json:"max_result_bytes"`
MaxResultItems int `json:"max_result_items"`
}
SchemaIntrospectionRequest is the operation-scoped payload required for one live connector schema read. Remote implementations must encrypt it before persistence and must not place credentials in queue arguments.
type SchemaObjectAPIField ¶
type SchemaObjectAPIObject ¶
type SchemaObjectAPIObject struct {
Name string `json:"name"`
Label string `json:"label,omitempty"`
Fields []SchemaObjectAPIField `json:"fields"`
Operations []SchemaObjectAPIOperation `json:"operations,omitempty"`
ProviderMetadata map[string]any `json:"provider_metadata,omitempty"`
}
type SchemaOperation ¶
type SchemaOperation struct {
Draft json.RawMessage `json:"draft,omitempty"`
Diagnostics []string `json:"diagnostics,omitempty"`
ID string `json:"id"`
Path string `json:"path"`
Method string `json:"method"`
Description string `json:"description,omitempty"`
RequestBody json.RawMessage `json:"request_body,omitempty"`
Responses json.RawMessage `json:"responses,omitempty"`
}
type SchemaResult ¶
type SchemaResult interface {
SchemaType() SchemaType
VendorType() string
}
SchemaResult is the common interface implemented by all schema variants.
type SchemaTable ¶
type SchemaTable struct {
Name string `json:"name"`
Columns []SchemaColumn `json:"columns"`
}
type SchemaType ¶
type SchemaType int
const ( SchemaTypeUnknown SchemaType = iota // unknown SchemaTypeSQL // sql SchemaTypeHTTP // http SchemaTypeDocument // document SchemaTypeFile // file SchemaTypeObjectAPI // object_api SchemaTypeSpreadsheet // spreadsheet )
func SchemaTypeString ¶
func SchemaTypeString(s string) (SchemaType, error)
SchemaTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func SchemaTypeValues ¶
func SchemaTypeValues() []SchemaType
SchemaTypeValues returns all values of the enum
func (SchemaType) IsASchemaType ¶
func (i SchemaType) IsASchemaType() bool
IsASchemaType returns "true" if the value is listed in the enum definition. "false" otherwise
func (SchemaType) MarshalJSON ¶
func (i SchemaType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for SchemaType
func (SchemaType) MarshalText ¶
func (i SchemaType) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for SchemaType
func (SchemaType) String ¶
func (i SchemaType) String() string
func (*SchemaType) UnmarshalJSON ¶
func (i *SchemaType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for SchemaType
func (*SchemaType) UnmarshalText ¶
func (i *SchemaType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for SchemaType
type SelectProviderRepositoryParams ¶
type SelectProviderRepositoryParams struct {
RepositoryID string `validate:"required"`
}
type Service ¶
type Service interface {
ConnectHTTPOAuth(context.Context, slug.Slug, slug.Slug, model.EventActor) (*HTTPOAuthConnection, error)
AttachOrganizationGitLabConnection(context.Context, slug.Slug, slug.Slug, model.EventActor) error
Create(
ctx context.Context,
orgSlug slug.Slug,
actor model.EventActor,
params *CreateParams,
) (*DataSource, error)
CreateProvisioned(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, params *CreateParams, provisioner SourceProvisioner) (*DataSource, error)
// StartProviderDataSourceInstall atomically creates a pending read-only provider data source and starts OAuth consent.
StartProviderDataSourceInstall(
ctx context.Context,
orgSlug slug.Slug,
actor model.EventActor,
provider string,
params *StartProviderDataSourceInstallParams,
) (*ProviderDataSourceInstall, error)
GetGoogleWorkspacePicker(context.Context, slug.Slug, slug.Slug) (*WorkspacePicker, error)
ListGoogleWorkspaceFiles(ctx context.Context, orgSlug, dsSlug slug.Slug, options workspace.ListOptions) (*workspace.Discovery, error)
GetGoogleWorkspaceFile(context.Context, slug.Slug, slug.Slug, string) (*workspace.File, error)
GetGoogleWorkspaceWorksheets(context.Context, slug.Slug, slug.Slug, string) (*workspace.Metadata, error)
VerifyGoogleWorkspaceFiles(context.Context, slug.Slug, slug.Slug, model.EventActor, WorkspaceVerificationParams) (*workspace.Discovery, error)
ListProviderRepositories(ctx context.Context, orgSlug, dsSlug slug.Slug) ([]ProviderRepository, error)
SelectProviderRepository(ctx context.Context, orgSlug, dsSlug slug.Slug, actor model.EventActor, params SelectProviderRepositoryParams) (*DataSource, error)
TestConnection(ctx context.Context, orgSlug slug.Slug, params *TestConnectionParams) error
TestExistingConnection(ctx context.Context, orgSlug, dsSlug slug.Slug) error
GetSnowflakeOnboarding(ctx context.Context, orgSlug, dsSlug slug.Slug) (*SnowflakeOnboarding, error)
FindBySlug(ctx context.Context, orgSlug, dsSlug slug.Slug) (*DataSource, error)
ListByOrg(
ctx context.Context,
orgSlug slug.Slug,
req model.ListRequest,
) (model.ListResponse[DataSource], error)
Update(
ctx context.Context,
orgSlug, dsSlug slug.Slug,
actor model.EventActor,
params *UpdateParams,
) (*DataSource, error)
UpdateCredentials(
ctx context.Context,
orgSlug, dsSlug slug.Slug,
actor model.EventActor,
params *UpdateCredentialsParams,
) (*DataSource, error)
CompleteProviderOAuthCallback(
ctx context.Context,
params credentialssvc.CompleteOAuthCallbackParams,
) (credentialssvc.CompleteOAuthCallbackResult, error)
ValidateCredentialLifecycle(
ctx context.Context,
orgSlug, dsSlug slug.Slug,
actor model.EventActor,
action model.EventAction,
) (*DataSource, error)
RecordCredentialLifecycleEvent(
ctx context.Context,
orgSlug, dsSlug slug.Slug,
actor model.EventActor,
action model.EventAction,
) error
ListBranches(ctx context.Context, orgSlug, dsSlug slug.Slug) ([]DataSourceBranch, error)
IntrospectSchema(ctx context.Context, orgSlug, dsSlug slug.Slug) (SchemaResult, error)
RefreshSchema(
ctx context.Context,
orgSlug, dsSlug slug.Slug,
actor model.EventActor,
) (*SchemaImportResult, error)
ExecuteQueuedSchemaImport(ctx context.Context, args jobs.DataSourceSchemaImportArgs) (*SchemaImportResult, error)
Delete(ctx context.Context, orgSlug, dsSlug slug.Slug, actor model.EventActor) error
Restore(ctx context.Context, orgSlug, dsSlug slug.Slug, actor model.EventActor) error
// ResolveGitAuth returns the authentication components needed to perform raw git
// operations against a git-compatible data source's configured repository.
// The returned GitDataSourceAuth.Cleanup must be called when operations complete.
// Returns ErrDataSourceNotFound if the slug does not exist.
// Returns ErrInvalidDataSourceType if the data source is not git, github, or gitlab.
ResolveGitAuth(ctx context.Context, orgSlug, dsSlug slug.Slug) (*GitDataSourceAuth, error)
EnsureProofWebhook(ctx context.Context, orgSlug, dsSlug slug.Slug) error
ResolveGitExecutionAuth(ctx context.Context, orgSlug, dsSlug slug.Slug) (*GitExecutionAuth, error)
}
Service defines the interface for data source business logic.
func New ¶
func New( txm postgres.TransactionManager, repo repods.Repository, schemaRepo repods.SchemaMetadataRepository, driftReports driftimpactrepo.Repository, credentials credentialssvc.Service, githubApps GitHubAppManager, gitLabWebhooks GitLabWebhookManager, admission admissionsvc.Service, ncf connector.NewConnectorFunc, eventProducer workerproducer.EventProducer, schemaImportProducer workerproducer.DataSourceSchemaImportProducer, config ServiceConfig, ) (Service, error)
New creates a new data source service. If ncf (connector factory function) is nil, uses the production NewConnector function.
func NewNoopService ¶
func NewNoopService() Service
NewNoopService returns a Service implementation that intentionally performs no work. This is exported for testing purposes only. Do not use in production code.
type ServiceConfig ¶
type ServiceConfig struct {
HTTPOAuthRedirectURI string
GoogleWorkspacePicker WorkspacePickerSettings
SnowflakeWIFIssuer string
CustomerConfigPolicy CustomerConfigPolicy
ConnectionTestExecutor ConnectionTestExecutor
SchemaIntrospectionExecutor SchemaIntrospectionExecutor
SchemaMaxBytes int
SchemaMaxItems int
GitBranchExecutor GitBranchExecutor
GitBranchMaxBytes int
GitBranchMaxItems int
}
ServiceConfig configures data source execution dependencies and limits.
type ServiceWithLogging ¶
type ServiceWithLogging struct {
// contains filtered or unexported fields
}
ServiceWithLogging implements Service with method completion logging.
func (ServiceWithLogging) AttachOrganizationGitLabConnection ¶
func (_d ServiceWithLogging) AttachOrganizationGitLabConnection(ctx context.Context, s1 slug.Slug, s2 slug.Slug, e1 model.EventActor) (err error)
AttachOrganizationGitLabConnection implements Service.
func (ServiceWithLogging) CompleteProviderOAuthCallback ¶
func (_d ServiceWithLogging) CompleteProviderOAuthCallback(ctx context.Context, params credentialssvc.CompleteOAuthCallbackParams) (c2 credentialssvc.CompleteOAuthCallbackResult, err error)
CompleteProviderOAuthCallback implements Service.
func (ServiceWithLogging) ConnectHTTPOAuth ¶
func (_d ServiceWithLogging) ConnectHTTPOAuth(ctx context.Context, s1 slug.Slug, s2 slug.Slug, e1 model.EventActor) (hp1 *HTTPOAuthConnection, err error)
ConnectHTTPOAuth implements Service.
func (ServiceWithLogging) Create ¶
func (_d ServiceWithLogging) Create(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, params *CreateParams) (dp1 *DataSource, err error)
Create implements Service.
func (ServiceWithLogging) CreateProvisioned ¶
func (_d ServiceWithLogging) CreateProvisioned(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, params *CreateParams, provisioner SourceProvisioner) (dp1 *DataSource, err error)
CreateProvisioned implements Service.
func (ServiceWithLogging) Delete ¶
func (_d ServiceWithLogging) Delete(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, actor model.EventActor) (err error)
Delete implements Service.
func (ServiceWithLogging) EnsureProofWebhook ¶
func (_d ServiceWithLogging) EnsureProofWebhook(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (err error)
EnsureProofWebhook implements Service.
func (ServiceWithLogging) ExecuteQueuedSchemaImport ¶
func (_d ServiceWithLogging) ExecuteQueuedSchemaImport(ctx context.Context, args jobs.DataSourceSchemaImportArgs) (sp1 *SchemaImportResult, err error)
ExecuteQueuedSchemaImport implements Service.
func (ServiceWithLogging) FindBySlug ¶
func (_d ServiceWithLogging) FindBySlug(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (dp1 *DataSource, err error)
FindBySlug implements Service.
func (ServiceWithLogging) GetGoogleWorkspaceFile ¶
func (_d ServiceWithLogging) GetGoogleWorkspaceFile(ctx context.Context, s1 slug.Slug, s2 slug.Slug, s3 string) (fp1 *workspace.File, err error)
GetGoogleWorkspaceFile implements Service.
func (ServiceWithLogging) GetGoogleWorkspacePicker ¶
func (_d ServiceWithLogging) GetGoogleWorkspacePicker(ctx context.Context, s1 slug.Slug, s2 slug.Slug) (wp1 *WorkspacePicker, err error)
GetGoogleWorkspacePicker implements Service.
func (ServiceWithLogging) GetGoogleWorkspaceWorksheets ¶
func (_d ServiceWithLogging) GetGoogleWorkspaceWorksheets(ctx context.Context, s1 slug.Slug, s2 slug.Slug, s3 string) (mp1 *workspace.Metadata, err error)
GetGoogleWorkspaceWorksheets implements Service.
func (ServiceWithLogging) GetSnowflakeOnboarding ¶
func (_d ServiceWithLogging) GetSnowflakeOnboarding(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (sp1 *SnowflakeOnboarding, err error)
GetSnowflakeOnboarding implements Service.
func (ServiceWithLogging) IntrospectSchema ¶
func (_d ServiceWithLogging) IntrospectSchema(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (s1 SchemaResult, err error)
IntrospectSchema implements Service.
func (ServiceWithLogging) ListBranches ¶
func (_d ServiceWithLogging) ListBranches(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (da1 []DataSourceBranch, err error)
ListBranches implements Service.
func (ServiceWithLogging) ListByOrg ¶
func (_d ServiceWithLogging) ListByOrg(ctx context.Context, orgSlug slug.Slug, req model.ListRequest) (p1 model.ListResponse[DataSource], err error)
ListByOrg implements Service.
func (ServiceWithLogging) ListGoogleWorkspaceFiles ¶
func (_d ServiceWithLogging) ListGoogleWorkspaceFiles(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, options workspace.ListOptions) (dp1 *workspace.Discovery, err error)
ListGoogleWorkspaceFiles implements Service.
func (ServiceWithLogging) ListProviderRepositories ¶
func (_d ServiceWithLogging) ListProviderRepositories(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (pa1 []ProviderRepository, err error)
ListProviderRepositories implements Service.
func (ServiceWithLogging) RecordCredentialLifecycleEvent ¶
func (_d ServiceWithLogging) RecordCredentialLifecycleEvent(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, actor model.EventActor, action model.EventAction) (err error)
RecordCredentialLifecycleEvent implements Service.
func (ServiceWithLogging) RefreshSchema ¶
func (_d ServiceWithLogging) RefreshSchema(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, actor model.EventActor) (sp1 *SchemaImportResult, err error)
RefreshSchema implements Service.
func (ServiceWithLogging) ResolveGitAuth ¶
func (_d ServiceWithLogging) ResolveGitAuth(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (gp1 *GitDataSourceAuth, err error)
ResolveGitAuth implements Service.
func (ServiceWithLogging) ResolveGitExecutionAuth ¶
func (_d ServiceWithLogging) ResolveGitExecutionAuth(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (gp1 *GitExecutionAuth, err error)
ResolveGitExecutionAuth implements Service.
func (ServiceWithLogging) Restore ¶
func (_d ServiceWithLogging) Restore(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, actor model.EventActor) (err error)
Restore implements Service.
func (ServiceWithLogging) SelectProviderRepository ¶
func (_d ServiceWithLogging) SelectProviderRepository(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, actor model.EventActor, params SelectProviderRepositoryParams) (dp1 *DataSource, err error)
SelectProviderRepository implements Service.
func (ServiceWithLogging) StartProviderDataSourceInstall ¶
func (_d ServiceWithLogging) StartProviderDataSourceInstall(ctx context.Context, orgSlug slug.Slug, actor model.EventActor, provider string, params *StartProviderDataSourceInstallParams) (pp1 *ProviderDataSourceInstall, err error)
StartProviderDataSourceInstall implements Service.
func (ServiceWithLogging) TestConnection ¶
func (_d ServiceWithLogging) TestConnection(ctx context.Context, orgSlug slug.Slug, params *TestConnectionParams) (err error)
TestConnection implements Service.
func (ServiceWithLogging) TestExistingConnection ¶
func (_d ServiceWithLogging) TestExistingConnection(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug) (err error)
TestExistingConnection implements Service.
func (ServiceWithLogging) Update ¶
func (_d ServiceWithLogging) Update(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, actor model.EventActor, params *UpdateParams) (dp1 *DataSource, err error)
Update implements Service.
func (ServiceWithLogging) UpdateCredentials ¶
func (_d ServiceWithLogging) UpdateCredentials(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, actor model.EventActor, params *UpdateCredentialsParams) (dp1 *DataSource, err error)
UpdateCredentials implements Service.
func (ServiceWithLogging) ValidateCredentialLifecycle ¶
func (_d ServiceWithLogging) ValidateCredentialLifecycle(ctx context.Context, orgSlug slug.Slug, dsSlug slug.Slug, actor model.EventActor, action model.EventAction) (dp1 *DataSource, err error)
ValidateCredentialLifecycle implements Service.
func (ServiceWithLogging) VerifyGoogleWorkspaceFiles ¶
func (_d ServiceWithLogging) VerifyGoogleWorkspaceFiles(ctx context.Context, s1 slug.Slug, s2 slug.Slug, e1 model.EventActor, w1 WorkspaceVerificationParams) (dp1 *workspace.Discovery, err error)
VerifyGoogleWorkspaceFiles implements Service.
type SnowflakeOnboarding ¶
type SnowflakeOnboarding struct {
IdentityState string
Active bool
Issuer string
Subject string
Audience string
SQL string
Diagnostic string
}
SnowflakeOnboarding contains public claims and customer-admin instructions only.
type SourceProvisioner ¶
type SourceProvisioner interface {
Provision(context.Context, postgres.DBTX, slug.Slug, *repods.CreateParams) error
}
SourceProvisioner persists a trusted source inside the core creation transaction. HTTP request payloads cannot select this compiled distribution dependency.
type StartProviderDataSourceInstallParams ¶
type StartProviderDataSourceInstallParams struct {
Name string `validate:"required,min=1,max=100"`
Slug slug.Slug
Type model.DataSourceType `validate:"required,datasourcetype"`
ConfigJSON json.RawMessage `validate:"required"`
ReadOnly *bool
}
StartProviderDataSourceInstallParams defines a new provider-backed data source before authorization.
type TestConnectionParams ¶
type TestConnectionParams struct {
Type model.DataSourceType `validate:"required,datasourcetype"`
ConfigJSON json.RawMessage `validate:"required"`
Credentials map[string]any
}
TestConnectionParams are the parameters for testing a draft data source connection.
type UpdateCredentialsParams ¶
UpdateCredentialsParams are the parameters for updating data source credentials.
type UpdateParams ¶
type UpdateParams struct {
Name string `validate:"omitempty,min=1,max=100"`
ConfigJSON json.RawMessage
ConfigFromCustomer bool
IsActive *bool
ReadOnly bool
ReadOnlySet bool
}
UpdateParams are the parameters for updating an existing data source.
type WorkspacePicker ¶
type WorkspacePicker struct {
WorkspacePickerSettings
AccountEmail string
ExpectedRevision int64
}
type WorkspacePickerSettings ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
filedata
Package filedata provides shared file-format detection, CSV/JSON/spreadsheet parsing, and schema inference helpers used by file-backed data source connectors (FTP, Git).
|
Package filedata provides shared file-format detection, CSV/JSON/spreadsheet parsing, and schema inference helpers used by file-backed data source connectors (FTP, Git). |
|
git
Package git provides a Git connector for Braidplane data sources.
|
Package git provides a Git connector for Braidplane data sources. |
|
param
Package param provides utilities for template parameter substitution in query strings.
|
Package param provides utilities for template parameter substitution in query strings. |
|
remotefile
Package remotefile adapts provider-owned file transports to Braidplane's shared file connector execution contract.
|
Package remotefile adapts provider-owned file transports to Braidplane's shared file connector execution contract. |
|
s3
Package s3 provides an S3-compatible object-store connector for Braidplane.
|
Package s3 provides an S3-compatible object-store connector for Braidplane. |