Documentation ¶
Index ¶
- Constants
- Variables
- type Author
- type AuthorBlock
- type AuthorStats
- type Bracket
- type Cluster
- type Image
- type Label
- type NotFoundError
- type Percentile
- type Post
- type PostRegistry
- func (pr *PostRegistry) AddAuthor(ctx context.Context, author *Author) error
- func (pr *PostRegistry) AddAuthorBlock(ctx context.Context, authorDID string, targetDID string, createdAt time.Time) error
- func (pr *PostRegistry) AddCVDataToImage(ctx context.Context, cid string, postID string, cvRunAt time.Time, ...) error
- func (pr *PostRegistry) AddImage(ctx context.Context, image *Image) error
- func (pr *PostRegistry) AddLikeToPost(ctx context.Context, postID string, authorDid string) error
- func (pr *PostRegistry) AddOneLabelPerPost(ctx context.Context, labels []string, postIDs []string, authorDIDs []string) error
- func (pr *PostRegistry) AddPost(ctx context.Context, post *Post) error
- func (pr *PostRegistry) AddPostLabel(ctx context.Context, postID string, authorDid string, label string) error
- func (pr *PostRegistry) AssignAuthorToCluster(ctx context.Context, authorDID string, clusterID int32) error
- func (pr *PostRegistry) AssignLabelToAuthorByAlias(ctx context.Context, authorDID string, labelAlias string) error
- func (pr *PostRegistry) Close() error
- func (pr *PostRegistry) CreateLabel(ctx context.Context, labelAlias string, labelName string) (*Label, error)
- func (pr *PostRegistry) GetAllLabels(ctx context.Context, limit int32, offset int32) ([]Label, error)
- func (pr *PostRegistry) GetAllTimeBangers(ctx context.Context, limit int32, offset int32) ([]*Post, error)
- func (pr *PostRegistry) GetAuthor(ctx context.Context, did string) (*Author, error)
- func (pr *PostRegistry) GetAuthorStats(ctx context.Context) (*AuthorStats, error)
- func (pr *PostRegistry) GetAuthorsByHandle(ctx context.Context, handle string) ([]*Author, error)
- func (pr *PostRegistry) GetBangerPostsForAuthor(ctx context.Context, did string, limit int32, offset int32) ([]*Post, error)
- func (pr *PostRegistry) GetBlockedByCount(ctx context.Context, targetDID string) (int64, error)
- func (pr *PostRegistry) GetBlocksPageForTarget(ctx context.Context, targetDID string, limit int32, offset int32) ([]*AuthorBlock, error)
- func (pr *PostRegistry) GetClusters(ctx context.Context) ([]*Cluster, error)
- func (pr *PostRegistry) GetImage(ctx context.Context, imageCID string, postID string) (*Image, error)
- func (pr *PostRegistry) GetImagesForPost(ctx context.Context, postID string) ([]*Image, error)
- func (pr *PostRegistry) GetLabelPage(ctx context.Context, limit int32, offset int32) ([]*Label, error)
- func (pr *PostRegistry) GetLabelsForAuthor(ctx context.Context, authorDID string) ([]*Label, error)
- func (pr *PostRegistry) GetMembersOfAuthorLabel(ctx context.Context, labelAlias string) ([]*Author, error)
- func (pr *PostRegistry) GetOldestPresentParent(ctx context.Context, postID string) (*Post, error)
- func (pr *PostRegistry) GetOptedOutAuthors(ctx context.Context) ([]*Author, error)
- func (pr *PostRegistry) GetPost(ctx context.Context, postID string) (*Post, error)
- func (pr *PostRegistry) GetPostPage(ctx context.Context, limit int32, offset int32) ([]Post, error)
- func (pr *PostRegistry) GetPostPageCursor(ctx context.Context, limit int32, cursor time.Time) ([]*Post, error)
- func (pr *PostRegistry) GetPostWithAuthorHandle(ctx context.Context, postID string) (*Post, error)
- func (pr *PostRegistry) GetPostsPageForAuthorLabel(ctx context.Context, authorLabel string, hoursAgo int32, limit int32, ...) ([]*Post, error)
- func (pr *PostRegistry) GetPostsPageForAuthorLabelFromView(ctx context.Context, authorLabel string, hoursAgo int32, limit int32, ...) ([]*Post, error)
- func (pr *PostRegistry) GetPostsPageForCluster(ctx context.Context, clusterAlias string, hoursAgo int32, limit int32, ...) ([]*Post, error)
- func (pr *PostRegistry) GetPostsPageForPostLabel(ctx context.Context, postLabel string, hoursAgo int32, limit int32, ...) ([]*Post, error)
- func (pr *PostRegistry) GetPostsPageForPostLabelByHotness(ctx context.Context, postLabel string, limit int32, cursor float64) ([]*Post, error)
- func (pr *PostRegistry) GetPostsPageForPostLabelChronological(ctx context.Context, postLabel string, limit int32, cursor time.Time) ([]*Post, error)
- func (pr *PostRegistry) GetPostsPageForPostLabelsByHotness(ctx context.Context, postLabels []string, limit int32, cursor float64) ([]*Post, error)
- func (pr *PostRegistry) GetPostsPageFromViewForCluster(ctx context.Context, clusterAlias string, hoursAgo int32, limit int32, ...) ([]*Post, error)
- func (pr *PostRegistry) GetThreadView(ctx context.Context, postID, authorID string) ([]PostView, error)
- func (pr *PostRegistry) GetUnindexedPostPage(ctx context.Context, limit int32, offset int32) ([]*Post, error)
- func (pr *PostRegistry) GetUniquePostLabels(ctx context.Context) ([]string, error)
- func (pr *PostRegistry) GetUnprocessedImages(ctx context.Context, limit int32) ([]*Image, error)
- func (pr *PostRegistry) RemoveBlock(ctx context.Context, actorDID string, targetDID string) error
- func (pr *PostRegistry) RemoveLikeFromPost(ctx context.Context, postID string) error
- func (pr *PostRegistry) SetIndexedAtTimestamp(ctx context.Context, postIDs []string, indexedAt time.Time) error
- func (pr *PostRegistry) SetSentimentResults(ctx context.Context, posts []*sentiment.SentimentPost) []error
- func (pr *PostRegistry) UnassignLabelFromAuthorByAlias(ctx context.Context, authorDID string, labelAlias string) error
- func (pr *PostRegistry) UpdateAuthorOptOut(ctx context.Context, did string, optOut bool) error
- type PostView
Constants ¶
View Source
const ( ReplyRelationship = "r" QuoteRelationship = "q" PositiveSentiment = "p" NegativeSentiment = "n" NeutralSentiment = "u" )
Post relationships
Variables ¶
View Source
var PostsNotFound = fmt.Errorf("posts not found")
Functions ¶
This section is empty.
Types ¶
type AuthorBlock ¶
type AuthorStats ¶
type Image ¶
type Image struct { CID string `json:"cid"` PostID string `json:"post_id"` AuthorDID string `json:"author_did"` AltText *string `json:"alt_text"` MimeType string `json:"mime_type"` CreatedAt time.Time `json:"created_at"` CVCompleted bool `json:"cv_completed"` CVRunAt *time.Time `json:"cv_run_at"` CVClasses *json.RawMessage `json:"cv_classes"` }
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
type Percentile ¶
type Post ¶
type Post struct { ID string `json:"id"` Text string `json:"text"` ParentPostID *string `json:"parent_post_id"` RootPostID *string `json:"root_post_id"` AuthorDID string `json:"author_did"` AuthorHandle *string `json:"author_handle"` CreatedAt time.Time `json:"created_at"` HasEmbeddedMedia bool `json:"has_embedded_media"` ParentRelationship *string `json:"parent_relationship"` // null, "r", "q" Sentiment *string `json:"sentiment"` SentimentConfidence *float64 `json:"sentiment_confidence"` Images []*Image `json:"images,omitempty"` Hotness *float64 `json:"hotness,omitempty"` Labels []string `json:"labels,omitempty"` IndexedAt *time.Time `json:"indexed_at,omitempty"` }
type PostRegistry ¶
type PostRegistry struct {
// contains filtered or unexported fields
}
func NewPostRegistry ¶
func NewPostRegistry(connectionString string) (*PostRegistry, error)
func (*PostRegistry) AddAuthor ¶
func (pr *PostRegistry) AddAuthor(ctx context.Context, author *Author) error
func (*PostRegistry) AddAuthorBlock ¶
func (*PostRegistry) AddCVDataToImage ¶
func (pr *PostRegistry) AddCVDataToImage(ctx context.Context, cid string, postID string, cvRunAt time.Time, cvClasses json.RawMessage) error
func (*PostRegistry) AddImage ¶
func (pr *PostRegistry) AddImage(ctx context.Context, image *Image) error
func (*PostRegistry) AddLikeToPost ¶
func (*PostRegistry) AddOneLabelPerPost ¶
func (*PostRegistry) AddPost ¶
func (pr *PostRegistry) AddPost(ctx context.Context, post *Post) error
func (*PostRegistry) AddPostLabel ¶
func (*PostRegistry) AssignAuthorToCluster ¶
func (*PostRegistry) AssignLabelToAuthorByAlias ¶
func (*PostRegistry) Close ¶
func (pr *PostRegistry) Close() error
func (*PostRegistry) CreateLabel ¶
func (*PostRegistry) GetAllLabels ¶
func (*PostRegistry) GetAllTimeBangers ¶
func (*PostRegistry) GetAuthorStats ¶
func (pr *PostRegistry) GetAuthorStats(ctx context.Context) (*AuthorStats, error)
func (*PostRegistry) GetAuthorsByHandle ¶
func (*PostRegistry) GetBangerPostsForAuthor ¶
func (*PostRegistry) GetBlockedByCount ¶
func (*PostRegistry) GetBlocksPageForTarget ¶
func (pr *PostRegistry) GetBlocksPageForTarget(ctx context.Context, targetDID string, limit int32, offset int32) ([]*AuthorBlock, error)
func (*PostRegistry) GetClusters ¶
func (pr *PostRegistry) GetClusters(ctx context.Context) ([]*Cluster, error)
func (*PostRegistry) GetImagesForPost ¶
func (*PostRegistry) GetLabelPage ¶
func (*PostRegistry) GetLabelsForAuthor ¶
func (*PostRegistry) GetMembersOfAuthorLabel ¶
func (*PostRegistry) GetOldestPresentParent ¶
func (*PostRegistry) GetOptedOutAuthors ¶
func (pr *PostRegistry) GetOptedOutAuthors(ctx context.Context) ([]*Author, error)
func (*PostRegistry) GetPostPage ¶
func (*PostRegistry) GetPostPageCursor ¶
func (*PostRegistry) GetPostWithAuthorHandle ¶
func (*PostRegistry) GetPostsPageForAuthorLabel ¶
func (*PostRegistry) GetPostsPageForAuthorLabelFromView ¶
func (*PostRegistry) GetPostsPageForCluster ¶
func (*PostRegistry) GetPostsPageForPostLabel ¶
func (*PostRegistry) GetPostsPageForPostLabelByHotness ¶
func (*PostRegistry) GetPostsPageForPostLabelChronological ¶
func (*PostRegistry) GetPostsPageForPostLabelsByHotness ¶
func (*PostRegistry) GetPostsPageFromViewForCluster ¶
func (*PostRegistry) GetThreadView ¶
func (*PostRegistry) GetUnindexedPostPage ¶
func (*PostRegistry) GetUniquePostLabels ¶
func (pr *PostRegistry) GetUniquePostLabels(ctx context.Context) ([]string, error)
func (*PostRegistry) GetUnprocessedImages ¶
func (*PostRegistry) RemoveBlock ¶
func (*PostRegistry) RemoveLikeFromPost ¶
func (pr *PostRegistry) RemoveLikeFromPost(ctx context.Context, postID string) error
func (*PostRegistry) SetIndexedAtTimestamp ¶
func (*PostRegistry) SetSentimentResults ¶
func (pr *PostRegistry) SetSentimentResults(ctx context.Context, posts []*sentiment.SentimentPost) []error
func (*PostRegistry) UnassignLabelFromAuthorByAlias ¶
func (*PostRegistry) UpdateAuthorOptOut ¶
Click to show internal directories.
Click to hide internal directories.