db

package
v0.0.0-...-0fdc06e Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptFollowRequestParams

type AcceptFollowRequestParams struct {
	Userid       int64
	Followuserid int64
}

type CountPostCommentRepliesTotalDepthParams

type CountPostCommentRepliesTotalDepthParams struct {
	Parent int64
	Depth  int64
}

type CountPostCommentsTotalDepthParams

type CountPostCommentsTotalDepthParams struct {
	Postid int64
	Depth  int64
}

type CountUserEventsParams

type CountUserEventsParams struct {
	Eventtype int16
	Userid    int64
	Created   int64
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteUserAvatarByFileParams

type DeleteUserAvatarByFileParams struct {
	Filetype int32
	Hash     string
}

type DeleteUserTokenByUIDAndTypeParams

type DeleteUserTokenByUIDAndTypeParams struct {
	Userid    int64
	Tokentype int16
}

type FollowUserParams

type FollowUserParams struct {
	Userid       int64
	Followuserid int64
	Accepted     bool
	Created      int64
}

type GetLatestPublicPostsByUserParams

type GetLatestPublicPostsByUserParams struct {
	Userid int64
	Offset int32
	Limit  int32
}

type GetLatestPublicPostsByUserRow

type GetLatestPublicPostsByUserRow struct {
	Postid    int64
	Published int64
	Updated   int64
	Content   string
}

type GetLatestPublicPostsForUserParams

type GetLatestPublicPostsForUserParams struct {
	Userid int64
	Offset int32
	Limit  int32
}

type GetLatestPublicPostsForUserRow

type GetLatestPublicPostsForUserRow struct {
	Postid    int64
	Userid    int64
	Published int64
	Updated   int64
	Content   string
}

type GetOldUserAvatarsRow

type GetOldUserAvatarsRow struct {
	Filetype int32
	Hash     string
}

type GetPostCanViewRow

type GetPostCanViewRow struct {
	Userid    int64
	Published int64
}

type GetPostCommentPostUserIDRow

type GetPostCommentPostUserIDRow struct {
	Postid int64
	Userid int64
}

type GetPostCommentRepliesParams

type GetPostCommentRepliesParams struct {
	Parent int64
	Depth  int64
	Offset int32
	Limit  int32
}

type GetPostCommentRepliesRow

type GetPostCommentRepliesRow struct {
	Postcomment Postcomment
	Depth       int64
}

type GetPostCommentRow

type GetPostCommentRow struct {
	Postcomment Postcomment
	Depth       int64
}

type GetPostCommentsParams

type GetPostCommentsParams struct {
	Postid  int64
	Offset  int32
	Limit   int32
	Depth   int64
	Limit_2 int32
}

type GetPostCommentsRow

type GetPostCommentsRow struct {
	Postcomment Postcomment
	Depth       int64
}

type GetPostMediaRow

type GetPostMediaRow struct {
	Alt    string
	Width  int32
	Height int32
	Hash   string
}

type GetPostRow

type GetPostRow struct {
	Userid    int64
	Created   int64
	Published int64
	Updated   int64
	Content   string
}

type GetPublicUserRow

type GetPublicUserRow struct {
	Username string
	Name     string
	Bio      string
	Type     int16
	Created  int64
}

type GetSessionRow

type GetSessionRow struct {
	Data       []byte
	Expiration int64
}

type GetUserPublicKeysParams

type GetUserPublicKeysParams struct {
	Userid   int64
	Replaced int64
}

type GetUserPublicKeysRow

type GetUserPublicKeysRow struct {
	Userkeyid     int64
	Publicarmored string
}

type GetUserTokenRow

type GetUserTokenRow struct {
	Usertokenid int64
	Userid      int64
	Tokentype   int16
	Token       string
	Expiration  int64
}

type InsertPostCommentClosureDeepParams

type InsertPostCommentClosureDeepParams struct {
	Child  int64
	Parent int64
}

type InsertPostCommentClosureSelfParams

type InsertPostCommentClosureSelfParams struct {
	Parent int64
	Child  int64
}

type InsertPostCommentParams

type InsertPostCommentParams struct {
	Postid  int64
	Userid  int64
	Parent  int64
	Created int64
	Content string
}

type InsertPostMediaFileParams

type InsertPostMediaFileParams struct {
	Created  int64
	Filetype int32
	Width    int32
	Height   int32
	Hash     string
	Newhash  string
}

type InsertPostMediaParams

type InsertPostMediaParams struct {
	Postid          int64
	Added           int64
	Alt             string
	Postmediafileid int64
}

type InsertPostParams

type InsertPostParams struct {
	Userid    int64
	Created   int64
	Published int64
	Content   string
}

type InsertSessionParams

type InsertSessionParams struct {
	Key        string
	Data       []byte
	Expiration int64
}

type InsertUserAvatarParams

type InsertUserAvatarParams struct {
	Userid   int64
	Created  int64
	Filetype int32
	Hash     string
}

type InsertUserEventKeyParams

type InsertUserEventKeyParams struct {
	Usereventid int32
	Userkeyid   int64
	Infokey     string
}

type InsertUserEventParams

type InsertUserEventParams struct {
	Userid    int64
	Eventtype int16
	Created   int64
	Info      string
}

type InsertUserKeyParams

type InsertUserKeyParams struct {
	Userid          int64
	Created         int64
	Authkeyhash     string
	Authkeysalt     string
	Publicarmored   string
	Privatearmored  string
	Recoverykeyhash string
	Recoveryarmored string
}

type InsertUserParams

type InsertUserParams struct {
	Username    string
	Email       string
	Type        int16
	Permissions int64
	Created     int64
}

type InsertUserTokenParams

type InsertUserTokenParams struct {
	Userid     int64
	Tokentype  int16
	Selector   string
	Token      string
	Created    int64
	Expiration int64
}

type IsFollowingParams

type IsFollowingParams struct {
	Userid       int64
	Followuserid int64
}

type Post

type Post struct {
	Postid    int64
	Userid    int64
	Created   int64
	Published int64
	Updated   int64
	Content   string
}

type Postcomment

type Postcomment struct {
	Postcommentid int64
	Postid        int64
	Userid        int64
	Parent        int64
	Created       int64
	Updated       int64
	Content       string
}

type Postcommentclosure

type Postcommentclosure struct {
	Parent int64
	Child  int64
	Depth  int64
}

type Postmediafile

type Postmediafile struct {
	Postmediafileid int64
	Created         int64
	Filetype        int32
	Width           int32
	Height          int32
	Hash            string
	Newhash         string
}

type Postmedium

type Postmedium struct {
	Postmediaid     int64
	Postid          int64
	Added           int64
	Active          bool
	Alt             string
	Postmediafileid int64
}

type PublishPostParams

type PublishPostParams struct {
	Published int64
	Postid    int64
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AcceptAllFollowRequests

func (q *Queries) AcceptAllFollowRequests(ctx context.Context, followuserid int64) error

func (*Queries) AcceptFollowRequest

func (q *Queries) AcceptFollowRequest(ctx context.Context, arg AcceptFollowRequestParams) error

func (*Queries) CountFollowers

func (q *Queries) CountFollowers(ctx context.Context, followuserid int64) (int64, error)

func (*Queries) CountPostCommentReplies

func (q *Queries) CountPostCommentReplies(ctx context.Context, parent int64) (int64, error)

func (*Queries) CountPostCommentRepliesTotalDepth

func (q *Queries) CountPostCommentRepliesTotalDepth(ctx context.Context, arg CountPostCommentRepliesTotalDepthParams) (int64, error)

func (*Queries) CountPostCommentsTopLevel

func (q *Queries) CountPostCommentsTopLevel(ctx context.Context, postid int64) (int64, error)

func (*Queries) CountPostCommentsTotal

func (q *Queries) CountPostCommentsTotal(ctx context.Context, postid int64) (int64, error)

func (*Queries) CountPostCommentsTotalDepth

func (q *Queries) CountPostCommentsTotalDepth(ctx context.Context, arg CountPostCommentsTotalDepthParams) (int64, error)

func (*Queries) CountPublicPostsByUser

func (q *Queries) CountPublicPostsByUser(ctx context.Context, userid int64) (int64, error)

func (*Queries) CountPublicPostsForUser

func (q *Queries) CountPublicPostsForUser(ctx context.Context, userid int64) (int64, error)

func (*Queries) CountUserEvents

func (q *Queries) CountUserEvents(ctx context.Context, arg CountUserEventsParams) (int64, error)

func (*Queries) DeactivateOldUserAvatars

func (q *Queries) DeactivateOldUserAvatars(ctx context.Context, userid int64) error

func (*Queries) DeactivateUserAvatar

func (q *Queries) DeactivateUserAvatar(ctx context.Context, userid int64) error

func (*Queries) DeleteOldSessions

func (q *Queries) DeleteOldSessions(ctx context.Context, expiration int64) error

func (*Queries) DeletePostComment

func (q *Queries) DeletePostComment(ctx context.Context, parent int64) error

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, key string) error

func (*Queries) DeleteUserAvatarByFile

func (q *Queries) DeleteUserAvatarByFile(ctx context.Context, arg DeleteUserAvatarByFileParams) error

func (*Queries) DeleteUserToken

func (q *Queries) DeleteUserToken(ctx context.Context, usertokenid int64) error

func (*Queries) DeleteUserTokenByUIDAndType

func (q *Queries) DeleteUserTokenByUIDAndType(ctx context.Context, arg DeleteUserTokenByUIDAndTypeParams) error

func (*Queries) FollowUser

func (q *Queries) FollowUser(ctx context.Context, arg FollowUserParams) error

func (*Queries) GetLatestPublicPostsByUser

func (q *Queries) GetLatestPublicPostsByUser(ctx context.Context, arg GetLatestPublicPostsByUserParams) ([]GetLatestPublicPostsByUserRow, error)

func (*Queries) GetOldUserAvatars

func (q *Queries) GetOldUserAvatars(ctx context.Context, userid int64) ([]GetOldUserAvatarsRow, error)

func (*Queries) GetPost

func (q *Queries) GetPost(ctx context.Context, postid int64) (GetPostRow, error)

func (*Queries) GetPostCanView

func (q *Queries) GetPostCanView(ctx context.Context, postid int64) (GetPostCanViewRow, error)

func (*Queries) GetPostComment

func (q *Queries) GetPostComment(ctx context.Context, child int64) (GetPostCommentRow, error)

func (*Queries) GetPostCommentPostID

func (q *Queries) GetPostCommentPostID(ctx context.Context, postcommentid int64) (int64, error)

func (*Queries) GetPostCommentPostUserID

func (q *Queries) GetPostCommentPostUserID(ctx context.Context, postcommentid int64) (GetPostCommentPostUserIDRow, error)

func (*Queries) GetPostCommentReplies

func (q *Queries) GetPostCommentReplies(ctx context.Context, arg GetPostCommentRepliesParams) ([]GetPostCommentRepliesRow, error)

func (*Queries) GetPostCommentUserID

func (q *Queries) GetPostCommentUserID(ctx context.Context, postcommentid int64) (int64, error)

func (*Queries) GetPostComments

func (q *Queries) GetPostComments(ctx context.Context, arg GetPostCommentsParams) ([]GetPostCommentsRow, error)

func (*Queries) GetPostMedia

func (q *Queries) GetPostMedia(ctx context.Context, postid int64) ([]GetPostMediaRow, error)

func (*Queries) GetPostMediaFileIDByHash

func (q *Queries) GetPostMediaFileIDByHash(ctx context.Context, hash string) (int64, error)

func (*Queries) GetPostPublishedStatus

func (q *Queries) GetPostPublishedStatus(ctx context.Context, postid int64) (int64, error)

func (*Queries) GetPostUserID

func (q *Queries) GetPostUserID(ctx context.Context, postid int64) (int64, error)

func (*Queries) GetPublicUser

func (q *Queries) GetPublicUser(ctx context.Context, userid int64) (GetPublicUserRow, error)

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, key string) (GetSessionRow, error)

func (*Queries) GetUserAuthKeyHash

func (q *Queries) GetUserAuthKeyHash(ctx context.Context, userid int64) (string, error)

func (*Queries) GetUserAuthKeySalt

func (q *Queries) GetUserAuthKeySalt(ctx context.Context, userid int64) (string, error)

func (*Queries) GetUserAvatarURLHash

func (q *Queries) GetUserAvatarURLHash(ctx context.Context, userid int64) (string, error)

func (*Queries) GetUserEmailByID

func (q *Queries) GetUserEmailByID(ctx context.Context, userid int64) (string, error)

func (*Queries) GetUserIDByEmail

func (q *Queries) GetUserIDByEmail(ctx context.Context, email string) (int64, error)

func (*Queries) GetUserIDByUserName

func (q *Queries) GetUserIDByUserName(ctx context.Context, username string) (int64, error)

func (*Queries) GetUserNameByID

func (q *Queries) GetUserNameByID(ctx context.Context, userid int64) (string, error)

func (*Queries) GetUserPermissions

func (q *Queries) GetUserPermissions(ctx context.Context, userid int64) (int64, error)

func (*Queries) GetUserPrivateArmoredKey

func (q *Queries) GetUserPrivateArmoredKey(ctx context.Context, userid int64) (string, error)

func (*Queries) GetUserPublicKeys

func (q *Queries) GetUserPublicKeys(ctx context.Context, arg GetUserPublicKeysParams) ([]GetUserPublicKeysRow, error)

func (*Queries) GetUserToken

func (q *Queries) GetUserToken(ctx context.Context, selector string) (GetUserTokenRow, error)

func (*Queries) GetUserType

func (q *Queries) GetUserType(ctx context.Context, userid int64) (int16, error)

func (*Queries) InsertPost

func (q *Queries) InsertPost(ctx context.Context, arg InsertPostParams) (int64, error)

func (*Queries) InsertPostComment

func (q *Queries) InsertPostComment(ctx context.Context, arg InsertPostCommentParams) (int64, error)

func (*Queries) InsertPostCommentClosureDeep

func (q *Queries) InsertPostCommentClosureDeep(ctx context.Context, arg InsertPostCommentClosureDeepParams) error

func (*Queries) InsertPostCommentClosureSelf

func (q *Queries) InsertPostCommentClosureSelf(ctx context.Context, arg InsertPostCommentClosureSelfParams) error

func (*Queries) InsertPostMedia

func (q *Queries) InsertPostMedia(ctx context.Context, arg InsertPostMediaParams) error

func (*Queries) InsertPostMediaFile

func (q *Queries) InsertPostMediaFile(ctx context.Context, arg InsertPostMediaFileParams) (int64, error)

func (*Queries) InsertSession

func (q *Queries) InsertSession(ctx context.Context, arg InsertSessionParams) error

func (*Queries) InsertUser

func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (int64, error)

func (*Queries) InsertUserAvatar

func (q *Queries) InsertUserAvatar(ctx context.Context, arg InsertUserAvatarParams) error

func (*Queries) InsertUserEvent

func (q *Queries) InsertUserEvent(ctx context.Context, arg InsertUserEventParams) (int32, error)

func (*Queries) InsertUserEventKey

func (q *Queries) InsertUserEventKey(ctx context.Context, arg InsertUserEventKeyParams) error

func (*Queries) InsertUserKey

func (q *Queries) InsertUserKey(ctx context.Context, arg InsertUserKeyParams) error

func (*Queries) InsertUserToken

func (q *Queries) InsertUserToken(ctx context.Context, arg InsertUserTokenParams) error

func (*Queries) IsFollowing

func (q *Queries) IsFollowing(ctx context.Context, arg IsFollowingParams) (bool, error)

func (*Queries) ListFollowRequests

func (q *Queries) ListFollowRequests(ctx context.Context, followuserid int64) ([]int64, error)

func (*Queries) ListFollowers

func (q *Queries) ListFollowers(ctx context.Context, followuserid int64) ([]int64, error)

func (*Queries) ListFollowing

func (q *Queries) ListFollowing(ctx context.Context, userid int64) ([]int64, error)

func (*Queries) PostMediaHashCheck

func (q *Queries) PostMediaHashCheck(ctx context.Context, hash string) (string, error)

func (*Queries) PublishPost

func (q *Queries) PublishPost(ctx context.Context, arg PublishPostParams) error

func (*Queries) SessionExist

func (q *Queries) SessionExist(ctx context.Context, key string) (bool, error)

func (*Queries) UnfollowUser

func (q *Queries) UnfollowUser(ctx context.Context, arg UnfollowUserParams) error

func (*Queries) UpdatePostCommentContent

func (q *Queries) UpdatePostCommentContent(ctx context.Context, arg UpdatePostCommentContentParams) error

func (*Queries) UpdatePostContent

func (q *Queries) UpdatePostContent(ctx context.Context, arg UpdatePostContentParams) error

func (*Queries) UpdateSession

func (q *Queries) UpdateSession(ctx context.Context, arg UpdateSessionParams) error

func (*Queries) UpdateUserBio

func (q *Queries) UpdateUserBio(ctx context.Context, arg UpdateUserBioParams) error

func (*Queries) UpdateUserName

func (q *Queries) UpdateUserName(ctx context.Context, arg UpdateUserNameParams) error

func (*Queries) UpdateUserPermissions

func (q *Queries) UpdateUserPermissions(ctx context.Context, arg UpdateUserPermissionsParams) error

func (*Queries) UpdateUserType

func (q *Queries) UpdateUserType(ctx context.Context, arg UpdateUserTypeParams) error

func (*Queries) UserHasAvatar

func (q *Queries) UserHasAvatar(ctx context.Context, userid int64) (bool, error)

func (*Queries) UserTokenSelectorExist

func (q *Queries) UserTokenSelectorExist(ctx context.Context, selector string) (bool, error)

func (*Queries) ValidateUserEmail

func (q *Queries) ValidateUserEmail(ctx context.Context, email string) (bool, error)

func (*Queries) ValidateUserName

func (q *Queries) ValidateUserName(ctx context.Context, username string) (bool, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Session

type Session struct {
	Key        string
	Data       []byte
	Expiration int64
}

type UnfollowUserParams

type UnfollowUserParams struct {
	Userid       int64
	Followuserid int64
}

type UpdatePostCommentContentParams

type UpdatePostCommentContentParams struct {
	Updated       int64
	Content       string
	Postcommentid int64
}

type UpdatePostContentParams

type UpdatePostContentParams struct {
	Updated int64
	Content string
	Postid  int64
}

type UpdateSessionParams

type UpdateSessionParams struct {
	Data       []byte
	Expiration int64
	Key        string
}

type UpdateUserBioParams

type UpdateUserBioParams struct {
	Bio    string
	Userid int64
}

type UpdateUserNameParams

type UpdateUserNameParams struct {
	Name   string
	Userid int64
}

type UpdateUserPermissionsParams

type UpdateUserPermissionsParams struct {
	Permissions int64
	Userid      int64
}

type UpdateUserTypeParams

type UpdateUserTypeParams struct {
	Type   int16
	Userid int64
}

type User

type User struct {
	Userid      int64
	Username    string
	Name        string
	Email       string
	Bio         string
	Type        int16
	Permissions int64
	Created     int64
}

type Useravatar

type Useravatar struct {
	Useravatarid int64
	Userid       int64
	Active       bool
	Created      int64
	Filetype     int32
	Hash         string
}

type Userevent

type Userevent struct {
	Usereventid int32
	Userid      int64
	Eventtype   int16
	Created     int64
	Info        string
}

type Usereventkey

type Usereventkey struct {
	Usereventkeyid int64
	Usereventid    int32
	Userkeyid      int64
	Infokey        string
}

type Userfollow

type Userfollow struct {
	Userfollowid int64
	Userid       int64
	Followuserid int64
	Accepted     bool
	Created      int64
}

type Userkey

type Userkey struct {
	Userkeyid       int64
	Userid          int64
	Created         int64
	Replaced        int64
	Authkeyhash     string
	Authkeysalt     string
	Publicarmored   string
	Privatearmored  string
	Recoverykeyhash string
	Recoveryarmored string
}

type Usertoken

type Usertoken struct {
	Usertokenid int64
	Userid      int64
	Tokentype   int16
	Selector    string
	Token       string
	Created     int64
	Expiration  int64
}

Jump to

Keyboard shortcuts

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