postgres

package
v0.0.0-...-0881364 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PAGER_SIZE = 15

Functions

This section is empty.

Types

type PsqlDB

type PsqlDB struct {
	Logger *zap.SugaredLogger
	Db     *sql.DB
}

func NewDB

func NewDB(cfg *config.ConfigCms) *PsqlDB

func (*PsqlDB) AddUser

func (me *PsqlDB) AddUser() (string, error)

func (*PsqlDB) AddViewCount

func (me *PsqlDB) AddViewCount(postID string) (int, error)

func (*PsqlDB) Close

func (me *PsqlDB) Close() error

func (*PsqlDB) FindAllPosts

func (me *PsqlDB) FindAllPosts(page *db.Pager, space string) (*db.Paginate[*db.Post], error)

func (*PsqlDB) FindAllUpdatedPosts

func (me *PsqlDB) FindAllUpdatedPosts(page *db.Pager, space string) (*db.Paginate[*db.Post], error)

func (*PsqlDB) FindKeysForUser

func (me *PsqlDB) FindKeysForUser(user *db.User) ([]*db.PublicKey, error)

func (*PsqlDB) FindPost

func (me *PsqlDB) FindPost(postID string) (*db.Post, error)

func (*PsqlDB) FindPostWithFilename

func (me *PsqlDB) FindPostWithFilename(filename string, persona_id string, space string) (*db.Post, error)

func (*PsqlDB) FindPosts

func (me *PsqlDB) FindPosts() ([]*db.Post, error)

func (*PsqlDB) FindPostsBeforeDate

func (me *PsqlDB) FindPostsBeforeDate(date *time.Time, space string) ([]*db.Post, error)

func (*PsqlDB) FindPostsForUser

func (me *PsqlDB) FindPostsForUser(userID string, space string) ([]*db.Post, error)

func (*PsqlDB) FindPublicKeyForKey

func (me *PsqlDB) FindPublicKeyForKey(key string) (*db.PublicKey, error)

func (*PsqlDB) FindSiteAnalytics

func (me *PsqlDB) FindSiteAnalytics(space string) (*db.Analytics, error)

func (*PsqlDB) FindUpdatedPostsForUser

func (me *PsqlDB) FindUpdatedPostsForUser(userID string, space string) ([]*db.Post, error)

func (*PsqlDB) FindUser

func (me *PsqlDB) FindUser(userID string) (*db.User, error)

func (*PsqlDB) FindUserForKey

func (me *PsqlDB) FindUserForKey(username string, key string) (*db.User, error)

func (*PsqlDB) FindUserForName

func (me *PsqlDB) FindUserForName(name string) (*db.User, error)

func (*PsqlDB) FindUserForNameAndKey

func (me *PsqlDB) FindUserForNameAndKey(name string, key string) (*db.User, error)

func (*PsqlDB) FindUsers

func (me *PsqlDB) FindUsers() ([]*db.User, error)

func (*PsqlDB) InsertPost

func (me *PsqlDB) InsertPost(userID string, filename string, title string, text string, description string, publishAt *time.Time, hidden bool, space string) (*db.Post, error)

func (*PsqlDB) LinkUserKey

func (me *PsqlDB) LinkUserKey(userID string, key string) error

func (*PsqlDB) RemoveKeys

func (me *PsqlDB) RemoveKeys(keyIDs []string) error

func (*PsqlDB) RemovePosts

func (me *PsqlDB) RemovePosts(postIDs []string) error

func (*PsqlDB) RemoveUsers

func (me *PsqlDB) RemoveUsers(userIDs []string) error

func (*PsqlDB) SetUserName

func (me *PsqlDB) SetUserName(userID string, name string) error

func (*PsqlDB) UpdatePost

func (me *PsqlDB) UpdatePost(postID string, title string, text string, description string, publishAt *time.Time) (*db.Post, error)

func (*PsqlDB) ValidateName

func (me *PsqlDB) ValidateName(name string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL