29 lines
1.1 KiB
Go
29 lines
1.1 KiB
Go
package database
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.dragse.it/anthrove/otter-space-sdk/pkg/models"
|
|
)
|
|
|
|
type Post interface {
|
|
|
|
// CreatePost adds a new post to the database.
|
|
CreatePost(ctx context.Context, anthrovePost *models.Post) error
|
|
|
|
// GetPostByAnthroveID retrieves a post by its Anthrove ID.
|
|
GetPostByAnthroveID(ctx context.Context, anthrovePostID models.AnthrovePostID) (*models.Post, error)
|
|
|
|
// GetPostByURL retrieves a post by its source URL.
|
|
GetPostByURL(ctx context.Context, postURL string) (*models.Post, error)
|
|
|
|
// GetPostBySourceID retrieves a post by its source ID.
|
|
GetPostBySourceID(ctx context.Context, sourceID models.AnthroveSourceID) (*models.Post, error)
|
|
|
|
// CreateTagAndReferenceToPost adds a tag with a relation to a post.
|
|
CreateTagAndReferenceToPost(ctx context.Context, anthrovePostID models.AnthrovePostID, anthroveTag *models.Tag) error
|
|
|
|
// CreateReferenceBetweenPostAndSource links a post with a source.
|
|
CreateReferenceBetweenPostAndSource(ctx context.Context, anthrovePostID models.AnthrovePostID, sourceDomain models.AnthroveSourceDomain, postURL models.AnthrovePostURL, config models.PostReferenceConfig) error
|
|
}
|