storage

package
v1.54.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage interface {
	// user storage
	GetUserByID(userID int64) (*sgtmpb.User, error)
	GetLastUsersList(limit int) ([]*sgtmpb.User, error)
	CreateUser(dbUser *sgtmpb.User) (*sgtmpb.User, error)
	GetUserBySlug(slug string) (*sgtmpb.User, error)
	UpdateUser(user *sgtmpb.User, updates interface{}) error
	GetUserRecentPost(userID int64) (*sgtmpb.User, error)

	// post storage
	GetPostList(limit int) ([]*sgtmpb.Post, error)
	GetTrackByCID(cid string) (*sgtmpb.Post, error)
	GetTrackBySCID(scid uint64) (*sgtmpb.Post, error)
	GetLastActivities(moulID int64) ([]*sgtmpb.Post, error)
	CreatePost(post *sgtmpb.Post) error
	GetPostBySlugOrID(postSlug string) (*sgtmpb.Post, error)
	GetPostComments(postID int64) ([]*sgtmpb.Post, error)
	UpdatePost(post *sgtmpb.Post, updates interface{}) error
	GetPostListByUserID(userID int64, limit int) ([]*sgtmpb.Post, int64, error)
	CheckAndUpdatePost(post *sgtmpb.Post) error

	// counts
	GetUploadsByWeek() ([]*sgtmpb.UploadsByWeek, error)
	GetNumberOfDraftPosts() (int64, error)
	GetNumberOfUsers() (int64, error)
	GetNumberOfPostsByKind() ([]*sgtmpb.PostByKind, error)
	GetTotalDuration() (int64, error)
	GetCalendarHeatMap(authorID int64) ([]int64, error)
}

func NewStorage

func NewStorage(db *gorm.DB) Storage

Jump to

Keyboard shortcuts

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