doc(source): added function documentation

Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
SoXX 2024-05-31 15:37:44 +02:00
parent 3e4560768b
commit e3a5adb2cc
3 changed files with 3 additions and 2 deletions

View File

@ -100,8 +100,8 @@ func GetAllSourceNodes(ctx context.Context, driver neo4j.DriverWithContext) ([]m
return sources, nil
}
// GetSourceNodesByURL returns the first models.AnthroveSource provided by the database
func GetSourceNodesByURL(ctx context.Context, driver neo4j.DriverWithContext, sourceUrl string) (*models.AnthroveSource, error) {
var source models.AnthroveSource
query := `

View File

@ -14,7 +14,7 @@ type Source interface {
// DeleteSource will delete a node with a given Domain
DeleteSource(ctx context.Context, anthroveSource *models.AnthroveSource) error
// GetSourceByURL returns the Source Node based on the URL
// GetSourceByURL returns the first models.AnthroveSource provided by the database
GetSourceByURL(ctx context.Context, sourceUrl string) (*models.AnthroveSource, error)
// GetSourceLinkForUser retrieves the links between a user and sources in the OtterSpace graph.

View File

@ -18,6 +18,7 @@ func (g *graphConnection) DeleteSource(ctx context.Context, anthroveSource *mode
return source.DeleteSourceNode(ctx, g.driver, anthroveSource)
}
// GetSourceByURL returns the first models.AnthroveSource provided by the database
func (g *graphConnection) GetSourceByURL(ctx context.Context, sourceUrl string) (*models.AnthroveSource, error) {
return source.GetSourceNodesByURL(ctx, g.driver, sourceUrl)
}