26 lines
1.3 KiB
Go
26 lines
1.3 KiB
Go
package graph
|
|
|
|
import (
|
|
"context"
|
|
"git.dragse.it/anthrove/otter-space-sdk/pkg/models"
|
|
)
|
|
|
|
type Source interface {
|
|
CreateSource(ctx context.Context, anthroveSource *models.AnthroveSource) error
|
|
DeleteSource(ctx context.Context, anthroveSource *models.AnthroveSource) error
|
|
|
|
// GetSourceByURL returns the Source Node based on the URL
|
|
GetSourceByURL(ctx context.Context, sourceUrl string) (*models.AnthroveSource, error)
|
|
|
|
// GetSourceLinkForUser retrieves the links between a user and sources in the OtterSpace graph.
|
|
// It returns a map of source domains to user-source relationships, and an error if the operation fails.
|
|
GetSourceLinkForUser(ctx context.Context, anthroveUserID models.AnthroveUserID) (map[string]models.AnthroveUserRelationship, error)
|
|
|
|
// GetSourceLinkForSpecifiedUser GetSourceLinkForUser retrieves the links between a user and a specific source in the OtterSpace graph.
|
|
// It returns a map of source domains to user-source relationships, and an error if the operation fails.
|
|
GetSourceLinkForSpecifiedUser(ctx context.Context, anthroveUserID models.AnthroveUserID, sourceDisplayName string) (map[string]models.AnthroveUserRelationship, error)
|
|
|
|
// GetAllSources returns a list of Sources in the database
|
|
GetAllSources(ctx context.Context) ([]models.AnthroveSource, error)
|
|
}
|