datasources
Package github.com/emergent-company/emergent.memory/apps/server/pkg/sdk/datasources
The datasources client manages data source integrations — connections to external systems (Google Drive, Notion, Confluence, etc.) that sync documents into the Memory platform.
Methods
Section titled “Methods”func (c *Client) ListProviders(ctx context.Context) ([]Provider, error)func (c *Client) GetProviderSchema(ctx context.Context, providerType string) (*ProviderSchema, error)func (c *Client) TestConfig(ctx context.Context, testReq *TestConfigRequest) (*TestConnectionResponse, error)func (c *Client) GetSourceTypes(ctx context.Context) ([]SourceType, error)func (c *Client) List(ctx context.Context, opts *ListIntegrationsOptions) ([]Integration, error)func (c *Client) Get(ctx context.Context, integrationID string) (*Integration, error)func (c *Client) Create(ctx context.Context, createReq *CreateIntegrationRequest) (*Integration, error)func (c *Client) Update(ctx context.Context, integrationID string, updateReq *UpdateIntegrationRequest) (*Integration, error)func (c *Client) Delete(ctx context.Context, integrationID string) errorfunc (c *Client) TestConnection(ctx context.Context, integrationID string) (*TestConnectionResponse, error)func (c *Client) TriggerSync(ctx context.Context, integrationID string, syncReq *TriggerSyncRequest) (*TriggerSyncResponse, error)Key Types
Section titled “Key Types”Provider
Section titled “Provider”type Provider struct { Type string Name string Description string AuthTypes []string}Integration
Section titled “Integration”type Integration struct { ID string Name string ProviderType string Status string Config map[string]interface{} LastSyncAt *time.Time ProjectID string CreatedAt time.Time}SyncJob
Section titled “SyncJob”type SyncJob struct { ID string IntegrationID string Status string StartedAt time.Time FinishedAt *time.Time DocumentsAdded int DocumentsUpdated int DocumentsDeleted int Error string}CreateIntegrationRequest
Section titled “CreateIntegrationRequest”type CreateIntegrationRequest struct { Name string ProviderType string Config map[string]interface{}}TriggerSyncRequest
Section titled “TriggerSyncRequest”type TriggerSyncRequest struct { FullSync bool // Force a full re-sync (default: incremental)}Example
Section titled “Example”// List available provider typesproviders, err := client.DataSources.ListProviders(ctx)for _, p := range providers { fmt.Printf("%s: %s\n", p.Type, p.Name)}
// Create a Google Drive integrationintegration, err := client.DataSources.Create(ctx, &datasources.CreateIntegrationRequest{ Name: "Team Drive", ProviderType: "google_drive", Config: map[string]interface{}{ "folder_id": "1BxiMVs...", "service_account": "...", },})
// Trigger syncsyncResp, err := client.DataSources.TriggerSync(ctx, integration.ID, &datasources.TriggerSyncRequest{ FullSync: false,})fmt.Printf("Sync job: %s\n", syncResp.JobID)