package graph import ( "context" "git.dragse.it/anthrove/otter-space-sdk/pkg/models" ) type Source interface { // CreateSource will always create a new node, it checks if a node with the same url exits and merges it. CreateSource(ctx context.Context, anthroveSource *models.AnthroveSource) error // DeleteSource will delete a node with a given Domain DeleteSource(ctx context.Context, anthroveSource *models.AnthroveSource) error // GetSourceByURL returns the first models.AnthroveSource provided by the database GetSourceByURL(ctx context.Context, sourceUrl models.AnthroveSourceDomain) (*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 models.AnthroveSourceDisplayName) (map[string]models.AnthroveUserRelationship, error) // GetAllSources returns a list of Sources in the database GetAllSources(ctx context.Context) ([]models.AnthroveSource, error) }