Documentation ¶
Index ¶
- Variables
- func CreatePostFromRow(r RowScanner) (*db.Post, error)
- func CreatePostWithTagsFromRow(r RowScanner) (*db.Post, error)
- type PsqlDB
- func (me *PsqlDB) AddUser() (string, error)
- func (me *PsqlDB) AddViewCount(postID string) (int, error)
- func (me *PsqlDB) Close() error
- func (me *PsqlDB) FindAllPosts(page *db.Pager, space string) (*db.Paginate[*db.Post], error)
- func (me *PsqlDB) FindAllPostsForUser(userID string, space string) ([]*db.Post, error)
- func (me *PsqlDB) FindAllProjects(page *db.Pager) (*db.Paginate[*db.Project], error)
- func (me *PsqlDB) FindAllUpdatedPosts(page *db.Pager, space string) (*db.Paginate[*db.Post], error)
- func (me *PsqlDB) FindExpiredPosts(space string) ([]*db.Post, error)
- func (me *PsqlDB) FindFeedItemsByPostID(postID string) ([]*db.FeedItem, error)
- func (me *PsqlDB) FindKeysForUser(user *db.User) ([]*db.PublicKey, error)
- func (me *PsqlDB) FindPopularTags(space string) ([]string, error)
- func (me *PsqlDB) FindPost(postID string) (*db.Post, error)
- func (me *PsqlDB) FindPostWithFilename(filename string, persona_id string, space string) (*db.Post, error)
- func (me *PsqlDB) FindPostWithSlug(slug string, user_id string, space string) (*db.Post, error)
- func (me *PsqlDB) FindPosts() ([]*db.Post, error)
- func (me *PsqlDB) FindPostsBeforeDate(date *time.Time, space string) ([]*db.Post, error)
- func (me *PsqlDB) FindPostsByTag(pager *db.Pager, tag, space string) (*db.Paginate[*db.Post], error)
- func (me *PsqlDB) FindPostsForUser(page *db.Pager, userID string, space string) (*db.Paginate[*db.Post], error)
- func (me *PsqlDB) FindProjectByName(userID, name string) (*db.Project, error)
- func (me *PsqlDB) FindProjectLinks(userID, name string) ([]*db.Project, error)
- func (me *PsqlDB) FindProjectsByPrefix(userID, prefix string) ([]*db.Project, error)
- func (me *PsqlDB) FindProjectsByUser(userID string) ([]*db.Project, error)
- func (me *PsqlDB) FindPublicKeyForKey(key string) (*db.PublicKey, error)
- func (me *PsqlDB) FindSiteAnalytics(space string) (*db.Analytics, error)
- func (me *PsqlDB) FindTagsForPost(postID string) ([]string, error)
- func (me *PsqlDB) FindTokensForUser(userID string) ([]*db.Token, error)
- func (me *PsqlDB) FindTotalSizeForUser(userID string) (int, error)
- func (me *PsqlDB) FindUpdatedPostsForUser(userID string, space string) ([]*db.Post, error)
- func (me *PsqlDB) FindUser(userID string) (*db.User, error)
- func (me *PsqlDB) FindUserForKey(username string, key string) (*db.User, error)
- func (me *PsqlDB) FindUserForName(name string) (*db.User, error)
- func (me *PsqlDB) FindUserForNameAndKey(name string, key string) (*db.User, error)
- func (me *PsqlDB) FindUserForToken(token string) (*db.User, error)
- func (me *PsqlDB) FindUserPostsByTag(page *db.Pager, tag, userID, space string) (*db.Paginate[*db.Post], error)
- func (me *PsqlDB) FindUsers() ([]*db.User, error)
- func (me *PsqlDB) HasFeatureForUser(userID string, feature string) bool
- func (me *PsqlDB) InsertFeedItems(postID string, items []*db.FeedItem) error
- func (me *PsqlDB) InsertPost(post *db.Post) (*db.Post, error)
- func (me *PsqlDB) InsertProject(userID, name, projectDir string) (string, error)
- func (me *PsqlDB) InsertToken(userID, name string) (string, error)
- func (me *PsqlDB) LinkToProject(userID, projectID, projectDir string, commit bool) error
- func (me *PsqlDB) LinkUserKey(userID string, key string) error
- func (me *PsqlDB) RemoveKeys(keyIDs []string) error
- func (me *PsqlDB) RemovePosts(postIDs []string) error
- func (me *PsqlDB) RemoveProject(projectID string) error
- func (me *PsqlDB) RemoveToken(tokenID string) error
- func (me *PsqlDB) RemoveUsers(userIDs []string) error
- func (me *PsqlDB) ReplaceAliasesForPost(aliases []string, postID string) error
- func (me *PsqlDB) ReplaceTagsForPost(tags []string, postID string) error
- func (me *PsqlDB) SetUserName(userID string, name string) error
- func (me *PsqlDB) UpdatePost(post *db.Post) (*db.Post, error)
- func (me *PsqlDB) UpdateProject(userID, name string) error
- func (me *PsqlDB) ValidateName(name string) (bool, error)
- type RowScanner
Constants ¶
This section is empty.
Variables ¶
View Source
var PAGER_SIZE = 15
View Source
var SelectPost = `` /* 189-byte string literal not displayed */
Functions ¶
func CreatePostFromRow ¶
func CreatePostFromRow(r RowScanner) (*db.Post, error)
func CreatePostWithTagsFromRow ¶
func CreatePostWithTagsFromRow(r RowScanner) (*db.Post, error)
Types ¶
type PsqlDB ¶
type PsqlDB struct { Logger *zap.SugaredLogger Db *sql.DB }
func (*PsqlDB) FindAllPosts ¶
func (*PsqlDB) FindAllPostsForUser ¶
func (*PsqlDB) FindAllProjects ¶ added in v1.2.0
func (*PsqlDB) FindAllUpdatedPosts ¶
func (*PsqlDB) FindExpiredPosts ¶
func (*PsqlDB) FindFeedItemsByPostID ¶ added in v1.1.5
func (*PsqlDB) FindKeysForUser ¶
func (*PsqlDB) FindPostWithFilename ¶
func (*PsqlDB) FindPostWithSlug ¶
func (*PsqlDB) FindPostsBeforeDate ¶
func (*PsqlDB) FindPostsByTag ¶
func (*PsqlDB) FindPostsForUser ¶
func (*PsqlDB) FindProjectByName ¶ added in v1.2.0
func (*PsqlDB) FindProjectLinks ¶ added in v1.2.0
func (*PsqlDB) FindProjectsByPrefix ¶ added in v1.2.0
func (*PsqlDB) FindProjectsByUser ¶ added in v1.2.0
func (*PsqlDB) FindPublicKeyForKey ¶
func (*PsqlDB) FindSiteAnalytics ¶
func (*PsqlDB) FindTokensForUser ¶ added in v1.2.0
func (*PsqlDB) FindTotalSizeForUser ¶
func (*PsqlDB) FindUpdatedPostsForUser ¶
func (*PsqlDB) FindUserForKey ¶
func (*PsqlDB) FindUserForNameAndKey ¶
func (*PsqlDB) FindUserForToken ¶ added in v1.2.0
func (*PsqlDB) FindUserPostsByTag ¶
func (*PsqlDB) HasFeatureForUser ¶
func (*PsqlDB) InsertFeedItems ¶ added in v1.1.5
func (*PsqlDB) InsertProject ¶ added in v1.2.0
func (*PsqlDB) InsertToken ¶ added in v1.2.0
func (*PsqlDB) LinkToProject ¶ added in v1.2.0
func (*PsqlDB) RemoveKeys ¶
func (*PsqlDB) RemovePosts ¶
func (*PsqlDB) RemoveProject ¶ added in v1.2.0
func (*PsqlDB) RemoveToken ¶ added in v1.2.0
func (*PsqlDB) RemoveUsers ¶
func (*PsqlDB) ReplaceAliasesForPost ¶ added in v1.1.5
func (*PsqlDB) ReplaceTagsForPost ¶
func (*PsqlDB) UpdateProject ¶ added in v1.2.0
type RowScanner ¶
Click to show internal directories.
Click to hide internal directories.