db

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	L   = "like"
	UL  = "unlike"
	R   = "retweet"
	C   = "comment"
	QR  = "qoute-retweet"
	F   = "follow"
	UF  = "unfollow"
	UR  = "unretweet"
	UQR = "unqoute-retweet"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID        int64          `json:"id"`
	Owner     string         `json:"owner"`
	IsPrivate bool           `json:"is_private"`
	CreatedAt time.Time      `json:"created_at"`
	Follower  int64          `json:"follower"`
	Following int64          `json:"following"`
	PhotoDir  sql.NullString `json:"photo_dir"`
}

type AccountNotif

type AccountNotif struct {
	ID           uuid.UUID      `json:"id"`
	AccountID    sql.NullInt64  `json:"account_id"`
	NotifType    string         `json:"notif_type"`
	IsRead       bool           `json:"is_read"`
	NotifTitle   sql.NullString `json:"notif_title"`
	NotifContent sql.NullString `json:"notif_content"`
	NotifTime    sql.NullTime   `json:"notif_time"`
	CreatedAt    time.Time      `json:"created_at"`
	Username     sql.NullString `json:"username"`
}

type AccountsFollow

type AccountsFollow struct {
	FromAccountID int64     `json:"from_account_id"`
	ToAccountID   int64     `json:"to_account_id"`
	Follow        bool      `json:"follow"`
	FollowAt      time.Time `json:"follow_at"`
}

type AccountsQueue

type AccountsQueue struct {
	FromAccountID int64     `json:"from_account_id"`
	Queue         bool      `json:"queue"`
	ToAccountID   int64     `json:"to_account_id"`
	QueueAt       time.Time `json:"queue_at"`
}

type CommentFeature

type CommentFeature struct {
	CommentID     uuid.UUID `json:"comment_id"`
	FromAccountID int64     `json:"from_account_id"`
	Comment       string    `json:"comment"`
	SumLike       int64     `json:"sum_like"`
	PostID        uuid.UUID `json:"post_id"`
	CreatedAt     time.Time `json:"created_at"`
}

type CreateAccountQueueParams

type CreateAccountQueueParams struct {
	FromAccountID int64 `json:"from_account_id"`
	ToAccountID   int64 `json:"to_account_id"`
}

type CreateAccountsFollowParams

type CreateAccountsFollowParams struct {
	FromAccountID int64 `json:"from_account_id"`
	ToAccountID   int64 `json:"to_account_id"`
	Follow        bool  `json:"follow"`
}

type CreateAccountsParams

type CreateAccountsParams struct {
	Owner     string         `json:"owner"`
	IsPrivate bool           `json:"is_private"`
	PhotoDir  sql.NullString `json:"photo_dir"`
}

type CreateComment_featureParams

type CreateComment_featureParams struct {
	CommentID     uuid.UUID `json:"comment_id"`
	FromAccountID int64     `json:"from_account_id"`
	Comment       string    `json:"comment"`
	PostID        uuid.UUID `json:"post_id"`
}

type CreateEntriesParams

type CreateEntriesParams struct {
	FromAccountID int64     `json:"from_account_id"`
	ToAccountID   int64     `json:"to_account_id"`
	PostID        uuid.UUID `json:"post_id"`
	TypeEntries   string    `json:"type_entries"`
}

type CreateLike_featureParams

type CreateLike_featureParams struct {
	FromAccountID int64     `json:"from_account_id"`
	IsLike        bool      `json:"is_like"`
	PostID        uuid.UUID `json:"post_id"`
}

type CreatePostParams

type CreatePostParams struct {
	ID                 uuid.UUID      `json:"id"`
	AccountID          int64          `json:"account_id"`
	IsRetweet          bool           `json:"is_retweet"`
	PictureDescription string         `json:"picture_description"`
	PhotoDir           sql.NullString `json:"photo_dir"`
}

type CreatePrivateQueueParams

type CreatePrivateQueueParams struct {
	Fromaccountid int64 `json:"fromaccountid"`
	Toaccountid   int64 `json:"toaccountid"`
}

type CreateQouteRetweet_featureParams

type CreateQouteRetweet_featureParams struct {
	FromAccountID int64     `json:"from_account_id"`
	QouteRetweet  bool      `json:"qoute_retweet"`
	Qoute         string    `json:"qoute"`
	PostID        uuid.UUID `json:"post_id"`
}

type CreateRetweetResult

type CreateRetweetResult struct {
	ErrCode int          `json:"err_code"`
	Post    PostTXResult `json:"post"`
}

type CreateRetweet_featureParams

type CreateRetweet_featureParams struct {
	FromAccountID int64     `json:"from_account_id"`
	Retweet       bool      `json:"retweet"`
	PostID        uuid.UUID `json:"post_id"`
}

type CreateSessionParams

type CreateSessionParams struct {
	ID           uuid.UUID `json:"id"`
	Username     string    `json:"username"`
	RefreshToken string    `json:"refresh_token"`
	UserAgent    string    `json:"user_agent"`
	ClientIp     string    `json:"client_ip"`
	IsBlocked    bool      `json:"is_blocked"`
	ExpiresAt    time.Time `json:"expires_at"`
}

type CreateUserParams

type CreateUserParams struct {
	Username       string `json:"username"`
	HashedPassword string `json:"hashed_password"`
	FullName       string `json:"full_name"`
	Email          string `json:"email"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DBTxRequest

type DBTxRequest struct {
	RemoveFunc func(ctx context.Context, key string) error
}

type DeleteAccountQueueParams

type DeleteAccountQueueParams struct {
	Fromaccountid int64 `json:"fromaccountid"`
	Toaccountid   int64 `json:"toaccountid"`
}

type DeleteAccountsFollowParams

type DeleteAccountsFollowParams struct {
	Fromid int64 `json:"fromid"`
	Toid   int64 `json:"toid"`
}

type DeleteAcoountsQueueParams

type DeleteAcoountsQueueParams struct {
	Fromid int64 `json:"fromid"`
	Toid   int64 `json:"toid"`
}

type DeleteQouteRetweetParams

type DeleteQouteRetweetParams struct {
	PostID        uuid.UUID `json:"post_id"`
	FromAccountID int64     `json:"from_account_id"`
}

type DeleteRetweetParams

type DeleteRetweetParams struct {
	PostID        uuid.UUID `json:"post_id"`
	FromAccountID int64     `json:"from_account_id"`
}

type Entry

type Entry struct {
	EntriesID     int64     `json:"entries_id"`
	FromAccountID int64     `json:"from_account_id"`
	ToAccountID   int64     `json:"to_account_id"`
	PostID        uuid.UUID `json:"post_id"`
	TypeEntries   string    `json:"type_entries"`
	CreatedAt     time.Time `json:"created_at"`
}

type GetAccountByEmailRow

type GetAccountByEmailRow struct {
	ID        int64          `json:"id"`
	Owner     string         `json:"owner"`
	IsPrivate bool           `json:"is_private"`
	Follower  int64          `json:"follower"`
	Following int64          `json:"following"`
	PhotoDir  sql.NullString `json:"photo_dir"`
}

type GetAccountsFollowParams

type GetAccountsFollowParams struct {
	Fromid int64 `json:"fromid"`
	Toid   int64 `json:"toid"`
}

type GetAccountsFollowRowsParams

type GetAccountsFollowRowsParams struct {
	Fromid int64 `json:"fromid"`
	Toid   int64 `json:"toid"`
}

type GetAccountsInfoRow

type GetAccountsInfoRow struct {
	IsPrivate bool  `json:"is_private"`
	ID        int64 `json:"id"`
}

type GetAccountsQueueParams

type GetAccountsQueueParams struct {
	Fromid int64 `json:"fromid"`
	Toid   int64 `json:"toid"`
}

type GetEmailParams

type GetEmailParams struct {
	Email    string `json:"email"`
	Username string `json:"username"`
}

type GetEmailRow

type GetEmailRow struct {
	Username string `json:"username"`
	Email    string `json:"email"`
}

type GetEntriesFullParams

type GetEntriesFullParams struct {
	PostID        uuid.UUID `json:"post_id"`
	FromAccountID int64     `json:"from_account_id"`
	TypeEntries   string    `json:"type_entries"`
}

type GetLikeInfoParams

type GetLikeInfoParams struct {
	FromAccountID int64     `json:"from_account_id"`
	PostID        uuid.UUID `json:"post_id"`
}

type GetLikeRowsParams

type GetLikeRowsParams struct {
	Fromaccountid int64     `json:"fromaccountid"`
	Postid        uuid.UUID `json:"postid"`
}

type GetPostJoinRow

type GetPostJoinRow struct {
	ID        uuid.UUID `json:"id"`
	AccountID int64     `json:"account_id"`
}

type GetPostQRetweetJoinParams

type GetPostQRetweetJoinParams struct {
	PostID        uuid.UUID `json:"post_id"`
	FromAccountID int64     `json:"from_account_id"`
}

type GetPostQRetweetJoinRow

type GetPostQRetweetJoinRow struct {
	ID           uuid.UUID `json:"id"`
	QouteRetweet bool      `json:"qoute_retweet"`
}

type GetPost_feature_UpdateRow

type GetPost_feature_UpdateRow struct {
	SumComment      int64 `json:"sum_comment"`
	SumLike         int64 `json:"sum_like"`
	SumRetweet      int64 `json:"sum_retweet"`
	SumQouteRetweet int64 `json:"sum_qoute_retweet"`
}

type GetPostidretweetJoinParams

type GetPostidretweetJoinParams struct {
	PostID        uuid.UUID `json:"post_id"`
	FromAccountID int64     `json:"from_account_id"`
}

type GetPostidretweetJoinRow

type GetPostidretweetJoinRow struct {
	ID      uuid.UUID `json:"id"`
	Retweet bool      `json:"retweet"`
}

type GetQouteRetweetParams

type GetQouteRetweetParams struct {
	FromAccountID int64     `json:"from_account_id"`
	PostID        uuid.UUID `json:"post_id"`
}

type GetQouteRetweetRowsParams

type GetQouteRetweetRowsParams struct {
	FromAccountID int64     `json:"from_account_id"`
	PostID        uuid.UUID `json:"post_id"`
}

type GetQueueRowsParams

type GetQueueRowsParams struct {
	Fromaccountid int64 `json:"fromaccountid"`
	Toaccountid   int64 `json:"toaccountid"`
}

type GetRetweetJoinParams

type GetRetweetJoinParams struct {
	Postid        uuid.UUID `json:"postid"`
	Fromaccountid int64     `json:"fromaccountid"`
}

type GetRetweetParams

type GetRetweetParams struct {
	FromAccountID int64     `json:"from_account_id"`
	PostID        uuid.UUID `json:"post_id"`
}

type GetRetweetRowsParams

type GetRetweetRowsParams struct {
	FromAccountID int64     `json:"from_account_id"`
	PostID        uuid.UUID `json:"post_id"`
}

type GetSessionuserRow

type GetSessionuserRow struct {
	IsBlocked bool      `json:"is_blocked"`
	ExpiresAt time.Time `json:"expires_at"`
}

type LikeFeature

type LikeFeature struct {
	FromAccountID int64     `json:"from_account_id"`
	IsLike        bool      `json:"is_like"`
	PostID        uuid.UUID `json:"post_id"`
	CreatedAt     time.Time `json:"created_at"`
}

type ListAccountsParams

type ListAccountsParams struct {
	Owner  string `json:"owner"`
	Limit  int32  `json:"limit"`
	Offset int32  `json:"offset"`
}

type ListCommentParams

type ListCommentParams struct {
	PostID uuid.UUID `json:"post_id"`
	Limit  int32     `json:"limit"`
	Offset int32     `json:"offset"`
}

type ListCommentRow

type ListCommentRow struct {
	CommentID     uuid.UUID `json:"comment_id"`
	FromAccountID int64     `json:"from_account_id"`
	Comment       string    `json:"comment"`
	SumLike       int64     `json:"sum_like"`
	CreatedAt     time.Time `json:"created_at"`
}

type ListEntriesParams

type ListEntriesParams struct {
	PostID uuid.UUID `json:"post_id"`
	Limit  int32     `json:"limit"`
	Offset int32     `json:"offset"`
}

type ListPostParams

type ListPostParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListQueueParams

type ListQueueParams struct {
	Limit     int32 `json:"limit"`
	Offset    int32 `json:"offset"`
	Accountid int64 `json:"accountid"`
}

type ListQueueRow

type ListQueueRow struct {
	Owner         string        `json:"owner"`
	FromAccountID sql.NullInt64 `json:"from_account_id"`
}

type ListUserParams

type ListUserParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type Model

type Model interface {
	CreateAccountsQueueTX(ctx context.Context, arg CreateAccountQueueParams) (bool, error)
}

type Post

type Post struct {
	ID                 uuid.UUID      `json:"id"`
	AccountID          int64          `json:"account_id"`
	PictureDescription string         `json:"picture_description"`
	PhotoDir           sql.NullString `json:"photo_dir"`
	IsRetweet          bool           `json:"is_retweet"`
	CreatedAt          time.Time      `json:"created_at"`
}

type PostFeature

type PostFeature struct {
	PostID          uuid.UUID `json:"post_id"`
	SumComment      int64     `json:"sum_comment"`
	SumLike         int64     `json:"sum_like"`
	SumRetweet      int64     `json:"sum_retweet"`
	SumQouteRetweet int64     `json:"sum_qoute_retweet"`
	CreatedAt       time.Time `json:"created_at"`
}

type PostTXResult

type PostTXResult struct {
	Post        Post        `json:"post"`
	PostFeature PostFeature `json:"post_feature"`
}

type PrivateAccountParams

type PrivateAccountParams struct {
	IsPrivate bool   `json:"is_private"`
	Username  string `json:"username"`
}

type QouteRetweetFeature

type QouteRetweetFeature struct {
	FromAccountID int64     `json:"from_account_id"`
	QouteRetweet  bool      `json:"qoute_retweet"`
	Qoute         string    `json:"qoute"`
	PostID        uuid.UUID `json:"post_id"`
	CreatedAt     time.Time `json:"created_at"`
}

type Querier

type Querier interface {
	CreateAccountQueue(ctx context.Context, arg CreateAccountQueueParams) (AccountsQueue, error)
	CreateAccounts(ctx context.Context, arg CreateAccountsParams) (Account, error)
	CreateAccountsFollow(ctx context.Context, arg CreateAccountsFollowParams) (AccountsFollow, error)
	CreateComment_feature(ctx context.Context, arg CreateComment_featureParams) (string, error)
	CreateEntries(ctx context.Context, arg CreateEntriesParams) (Entry, error)
	CreateLike_feature(ctx context.Context, arg CreateLike_featureParams) error
	CreatePost(ctx context.Context, arg CreatePostParams) (Post, error)
	CreatePost_feature(ctx context.Context, postID uuid.UUID) (PostFeature, error)
	CreatePrivateQueue(ctx context.Context, arg CreatePrivateQueueParams) (AccountsQueue, error)
	CreateQouteRetweet_feature(ctx context.Context, arg CreateQouteRetweet_featureParams) (string, error)
	CreateRetweet_feature(ctx context.Context, arg CreateRetweet_featureParams) error
	CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
	DeleteAccountQueue(ctx context.Context, arg DeleteAccountQueueParams) error
	DeleteAccountsFollow(ctx context.Context, arg DeleteAccountsFollowParams) error
	DeleteAcoountsQueue(ctx context.Context, arg DeleteAcoountsQueueParams) error
	DeletePost(ctx context.Context, id uuid.UUID) error
	DeletePostFeature(ctx context.Context, postID uuid.UUID) error
	DeleteQouteRetweet(ctx context.Context, arg DeleteQouteRetweetParams) error
	DeleteRetweet(ctx context.Context, arg DeleteRetweetParams) error
	GetAccountByEmail(ctx context.Context, email string) (GetAccountByEmailRow, error)
	GetAccountForUpdate(ctx context.Context, id int64) (Account, error)
	GetAccounts(ctx context.Context, id int64) (Account, error)
	GetAccountsFollow(ctx context.Context, arg GetAccountsFollowParams) (bool, error)
	GetAccountsFollowRows(ctx context.Context, arg GetAccountsFollowRowsParams) (int64, error)
	GetAccountsInfo(ctx context.Context, id int64) (GetAccountsInfoRow, error)
	GetAccountsOwner(ctx context.Context, owner string) (Account, error)
	GetAccountsQueue(ctx context.Context, arg GetAccountsQueueParams) (bool, error)
	GetEmail(ctx context.Context, arg GetEmailParams) (GetEmailRow, error)
	GetEntries(ctx context.Context, entriesID int64) (Entry, error)
	GetEntriesFull(ctx context.Context, arg GetEntriesFullParams) error
	GetLikeInfo(ctx context.Context, arg GetLikeInfoParams) (LikeFeature, error)
	GetLikeRows(ctx context.Context, arg GetLikeRowsParams) (int64, error)
	GetLikejoin(ctx context.Context, postid uuid.UUID) (bool, error)
	GetPost(ctx context.Context, id uuid.UUID) (Post, error)
	GetPostJoin(ctx context.Context, id uuid.UUID) (GetPostJoinRow, error)
	GetPostQRetweetJoin(ctx context.Context, arg GetPostQRetweetJoinParams) (GetPostQRetweetJoinRow, error)
	GetPost_feature(ctx context.Context, postID uuid.UUID) (PostFeature, error)
	GetPost_feature_Update(ctx context.Context, postID uuid.UUID) (GetPost_feature_UpdateRow, error)
	GetPostidretweetJoin(ctx context.Context, arg GetPostidretweetJoinParams) (GetPostidretweetJoinRow, error)
	GetQouteRetweet(ctx context.Context, arg GetQouteRetweetParams) (QouteRetweetFeature, error)
	GetQouteRetweetJoin(ctx context.Context, postID uuid.UUID) (bool, error)
	GetQouteRetweetRows(ctx context.Context, arg GetQouteRetweetRowsParams) (int64, error)
	GetQueueRows(ctx context.Context, arg GetQueueRowsParams) (int64, error)
	GetRetweet(ctx context.Context, arg GetRetweetParams) (RetweetFeature, error)
	GetRetweetJoin(ctx context.Context, arg GetRetweetJoinParams) (bool, error)
	GetRetweetRows(ctx context.Context, arg GetRetweetRowsParams) (int64, error)
	GetSession(ctx context.Context, id uuid.UUID) (Session, error)
	GetSessionuser(ctx context.Context, username string) (GetSessionuserRow, error)
	GetUser(ctx context.Context, username string) (User, error)
	ListAccounts(ctx context.Context, arg ListAccountsParams) ([]Account, error)
	ListComment(ctx context.Context, arg ListCommentParams) ([]ListCommentRow, error)
	ListEntries(ctx context.Context, arg ListEntriesParams) ([]Entry, error)
	ListPost(ctx context.Context, arg ListPostParams) ([]Post, error)
	ListQueue(ctx context.Context, arg ListQueueParams) ([]ListQueueRow, error)
	ListUser(ctx context.Context, arg ListUserParams) ([]User, error)
	PrivateAccount(ctx context.Context, arg PrivateAccountParams) error
	UpdateAccountFollower(ctx context.Context, arg UpdateAccountFollowerParams) (Account, error)
	UpdateAccountFollowing(ctx context.Context, arg UpdateAccountFollowingParams) (Account, error)
	UpdateAccountQueue(ctx context.Context, arg UpdateAccountQueueParams) error
	UpdateLike(ctx context.Context, arg UpdateLikeParams) error
	UpdatePhoto(ctx context.Context, arg UpdatePhotoParams) error
	UpdatePost(ctx context.Context, arg UpdatePostParams) (Post, error)
	UpdatePost_feature(ctx context.Context, arg UpdatePost_featureParams) (PostFeature, error)
	UpdateQouteRetweet(ctx context.Context, arg UpdateQouteRetweetParams) error
	UpdateRetweet(ctx context.Context, arg UpdateRetweetParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAccountQueue

func (q *Queries) CreateAccountQueue(ctx context.Context, arg CreateAccountQueueParams) (AccountsQueue, error)

func (*Queries) CreateAccounts

func (q *Queries) CreateAccounts(ctx context.Context, arg CreateAccountsParams) (Account, error)

func (*Queries) CreateAccountsFollow

func (q *Queries) CreateAccountsFollow(ctx context.Context, arg CreateAccountsFollowParams) (AccountsFollow, error)

func (*Queries) CreateComment_feature

func (q *Queries) CreateComment_feature(ctx context.Context, arg CreateComment_featureParams) (string, error)

func (*Queries) CreateEntries

func (q *Queries) CreateEntries(ctx context.Context, arg CreateEntriesParams) (Entry, error)

func (*Queries) CreateLike_feature

func (q *Queries) CreateLike_feature(ctx context.Context, arg CreateLike_featureParams) error

func (*Queries) CreatePost

func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (Post, error)

func (*Queries) CreatePost_feature

func (q *Queries) CreatePost_feature(ctx context.Context, postID uuid.UUID) (PostFeature, error)

func (*Queries) CreatePrivateQueue

func (q *Queries) CreatePrivateQueue(ctx context.Context, arg CreatePrivateQueueParams) (AccountsQueue, error)

func (*Queries) CreateQouteRetweet_feature

func (q *Queries) CreateQouteRetweet_feature(ctx context.Context, arg CreateQouteRetweet_featureParams) (string, error)

func (*Queries) CreateRetweet_feature

func (q *Queries) CreateRetweet_feature(ctx context.Context, arg CreateRetweet_featureParams) error

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteAccountQueue

func (q *Queries) DeleteAccountQueue(ctx context.Context, arg DeleteAccountQueueParams) error

func (*Queries) DeleteAccountsFollow

func (q *Queries) DeleteAccountsFollow(ctx context.Context, arg DeleteAccountsFollowParams) error

func (*Queries) DeleteAcoountsQueue

func (q *Queries) DeleteAcoountsQueue(ctx context.Context, arg DeleteAcoountsQueueParams) error

func (*Queries) DeletePost

func (q *Queries) DeletePost(ctx context.Context, id uuid.UUID) error

func (*Queries) DeletePostFeature

func (q *Queries) DeletePostFeature(ctx context.Context, postID uuid.UUID) error

func (*Queries) DeleteQouteRetweet

func (q *Queries) DeleteQouteRetweet(ctx context.Context, arg DeleteQouteRetweetParams) error

func (*Queries) DeleteRetweet

func (q *Queries) DeleteRetweet(ctx context.Context, arg DeleteRetweetParams) error

func (*Queries) GetAccountByEmail

func (q *Queries) GetAccountByEmail(ctx context.Context, email string) (GetAccountByEmailRow, error)

func (*Queries) GetAccountForUpdate

func (q *Queries) GetAccountForUpdate(ctx context.Context, id int64) (Account, error)

func (*Queries) GetAccounts

func (q *Queries) GetAccounts(ctx context.Context, id int64) (Account, error)

func (*Queries) GetAccountsFollow

func (q *Queries) GetAccountsFollow(ctx context.Context, arg GetAccountsFollowParams) (bool, error)

func (*Queries) GetAccountsFollowRows

func (q *Queries) GetAccountsFollowRows(ctx context.Context, arg GetAccountsFollowRowsParams) (int64, error)

func (*Queries) GetAccountsInfo

func (q *Queries) GetAccountsInfo(ctx context.Context, id int64) (GetAccountsInfoRow, error)

func (*Queries) GetAccountsOwner

func (q *Queries) GetAccountsOwner(ctx context.Context, owner string) (Account, error)

func (*Queries) GetAccountsQueue

func (q *Queries) GetAccountsQueue(ctx context.Context, arg GetAccountsQueueParams) (bool, error)

func (*Queries) GetEmail

func (q *Queries) GetEmail(ctx context.Context, arg GetEmailParams) (GetEmailRow, error)

func (*Queries) GetEntries

func (q *Queries) GetEntries(ctx context.Context, entriesID int64) (Entry, error)

func (*Queries) GetEntriesFull

func (q *Queries) GetEntriesFull(ctx context.Context, arg GetEntriesFullParams) error

func (*Queries) GetLikeInfo

func (q *Queries) GetLikeInfo(ctx context.Context, arg GetLikeInfoParams) (LikeFeature, error)

func (*Queries) GetLikeRows

func (q *Queries) GetLikeRows(ctx context.Context, arg GetLikeRowsParams) (int64, error)

func (*Queries) GetLikejoin

func (q *Queries) GetLikejoin(ctx context.Context, postid uuid.UUID) (bool, error)

func (*Queries) GetPost

func (q *Queries) GetPost(ctx context.Context, id uuid.UUID) (Post, error)

func (*Queries) GetPostJoin

func (q *Queries) GetPostJoin(ctx context.Context, id uuid.UUID) (GetPostJoinRow, error)

func (*Queries) GetPostQRetweetJoin

func (q *Queries) GetPostQRetweetJoin(ctx context.Context, arg GetPostQRetweetJoinParams) (GetPostQRetweetJoinRow, error)

func (*Queries) GetPost_feature

func (q *Queries) GetPost_feature(ctx context.Context, postID uuid.UUID) (PostFeature, error)

func (*Queries) GetPost_feature_Update

func (q *Queries) GetPost_feature_Update(ctx context.Context, postID uuid.UUID) (GetPost_feature_UpdateRow, error)

func (*Queries) GetPostidretweetJoin

func (q *Queries) GetPostidretweetJoin(ctx context.Context, arg GetPostidretweetJoinParams) (GetPostidretweetJoinRow, error)

func (*Queries) GetQouteRetweet

func (q *Queries) GetQouteRetweet(ctx context.Context, arg GetQouteRetweetParams) (QouteRetweetFeature, error)

func (*Queries) GetQouteRetweetJoin

func (q *Queries) GetQouteRetweetJoin(ctx context.Context, postID uuid.UUID) (bool, error)

func (*Queries) GetQouteRetweetRows

func (q *Queries) GetQouteRetweetRows(ctx context.Context, arg GetQouteRetweetRowsParams) (int64, error)

func (*Queries) GetQueueRows

func (q *Queries) GetQueueRows(ctx context.Context, arg GetQueueRowsParams) (int64, error)

func (*Queries) GetRetweet

func (q *Queries) GetRetweet(ctx context.Context, arg GetRetweetParams) (RetweetFeature, error)

func (*Queries) GetRetweetJoin

func (q *Queries) GetRetweetJoin(ctx context.Context, arg GetRetweetJoinParams) (bool, error)

func (*Queries) GetRetweetRows

func (q *Queries) GetRetweetRows(ctx context.Context, arg GetRetweetRowsParams) (int64, error)

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (Session, error)

func (*Queries) GetSessionuser

func (q *Queries) GetSessionuser(ctx context.Context, username string) (GetSessionuserRow, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, username string) (User, error)

func (*Queries) ListAccounts

func (q *Queries) ListAccounts(ctx context.Context, arg ListAccountsParams) ([]Account, error)

func (*Queries) ListComment

func (q *Queries) ListComment(ctx context.Context, arg ListCommentParams) ([]ListCommentRow, error)

func (*Queries) ListEntries

func (q *Queries) ListEntries(ctx context.Context, arg ListEntriesParams) ([]Entry, error)

func (*Queries) ListPost

func (q *Queries) ListPost(ctx context.Context, arg ListPostParams) ([]Post, error)

func (*Queries) ListQueue

func (q *Queries) ListQueue(ctx context.Context, arg ListQueueParams) ([]ListQueueRow, error)

func (*Queries) ListUser

func (q *Queries) ListUser(ctx context.Context, arg ListUserParams) ([]User, error)

func (*Queries) PrivateAccount

func (q *Queries) PrivateAccount(ctx context.Context, arg PrivateAccountParams) error

func (*Queries) UpdateAccountFollower

func (q *Queries) UpdateAccountFollower(ctx context.Context, arg UpdateAccountFollowerParams) (Account, error)

func (*Queries) UpdateAccountFollowing

func (q *Queries) UpdateAccountFollowing(ctx context.Context, arg UpdateAccountFollowingParams) (Account, error)

func (*Queries) UpdateAccountQueue

func (q *Queries) UpdateAccountQueue(ctx context.Context, arg UpdateAccountQueueParams) error

func (*Queries) UpdateLike

func (q *Queries) UpdateLike(ctx context.Context, arg UpdateLikeParams) error

func (*Queries) UpdatePhoto

func (q *Queries) UpdatePhoto(ctx context.Context, arg UpdatePhotoParams) error

func (*Queries) UpdatePost

func (q *Queries) UpdatePost(ctx context.Context, arg UpdatePostParams) (Post, error)

func (*Queries) UpdatePost_feature

func (q *Queries) UpdatePost_feature(ctx context.Context, arg UpdatePost_featureParams) (PostFeature, error)

func (*Queries) UpdateQouteRetweet

func (q *Queries) UpdateQouteRetweet(ctx context.Context, arg UpdateQouteRetweetParams) error

func (*Queries) UpdateRetweet

func (q *Queries) UpdateRetweet(ctx context.Context, arg UpdateRetweetParams) error

func (*Queries) WithTx

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

type RetweetFeature

type RetweetFeature struct {
	FromAccountID int64     `json:"from_account_id"`
	Retweet       bool      `json:"retweet"`
	PostID        uuid.UUID `json:"post_id"`
	CreatedAt     time.Time `json:"created_at"`
}

type SQLStore

type SQLStore struct {
	*Queries
	DB *sql.DB
}

func NewStore

func NewStore(projectDB *sql.DB) *SQLStore

func (*SQLStore) CreateAccountsQueueTX

func (s *SQLStore) CreateAccountsQueueTX(ctx context.Context, arg CreateAccountQueueParams) (bool, error)

func (*SQLStore) DBTx

func (s *SQLStore) DBTx(ctx context.Context, fn func(q *Queries) error) error

func (*SQLStore) DBnTx

func (s *SQLStore) DBnTx(ctx context.Context, removeFn func(ctx context.Context, key string) error, fn func(q *Queries) (string, error)) error

DBnTx is a function that will be used to execute a transaction with a function that returns a string and a function that will be used to remove the key from the third party db/cloud example: redis and gcp

type Session

type Session struct {
	ID           uuid.UUID `json:"id"`
	Username     string    `json:"username"`
	RefreshToken string    `json:"refresh_token"`
	UserAgent    string    `json:"user_agent"`
	ClientIp     string    `json:"client_ip"`
	IsBlocked    bool      `json:"is_blocked"`
	ExpiresAt    time.Time `json:"expires_at"`
	CreatedAt    time.Time `json:"created_at"`
}

type Token

type Token struct {
	Email        string                `json:"email"`
	AccessToken  string                `json:"access_token"`
	RefreshToken sql.NullString        `json:"refresh_token"`
	TokenType    sql.NullString        `json:"token_type"`
	Expiry       sql.NullTime          `json:"expiry"`
	Raw          pqtype.NullRawMessage `json:"raw"`
	ID           uuid.UUID             `json:"id"`
}

type UpdateAccountFollowerParams

type UpdateAccountFollowerParams struct {
	Num int64 `json:"num"`
	ID  int64 `json:"id"`
}

type UpdateAccountFollowingParams

type UpdateAccountFollowingParams struct {
	Num int64 `json:"num"`
	ID  int64 `json:"id"`
}

type UpdateAccountQueueParams

type UpdateAccountQueueParams struct {
	Queue         bool  `json:"queue"`
	Fromaccountid int64 `json:"fromaccountid"`
	Toaccountid   int64 `json:"toaccountid"`
}

type UpdateLikeParams

type UpdateLikeParams struct {
	IsLike        bool      `json:"is_like"`
	PostID        uuid.UUID `json:"post_id"`
	FromAccountID int64     `json:"from_account_id"`
}

type UpdatePhotoParams

type UpdatePhotoParams struct {
	Filedirectory sql.NullString `json:"filedirectory"`
	Username      string         `json:"username"`
	Accountid     int64          `json:"accountid"`
}

type UpdatePostParams

type UpdatePostParams struct {
	ID                 uuid.UUID `json:"id"`
	PictureDescription string    `json:"picture_description"`
}

type UpdatePost_featureParams

type UpdatePost_featureParams struct {
	PostID          uuid.UUID `json:"post_id"`
	SumComment      int64     `json:"sum_comment"`
	SumLike         int64     `json:"sum_like"`
	SumRetweet      int64     `json:"sum_retweet"`
	SumQouteRetweet int64     `json:"sum_qoute_retweet"`
}

type UpdateQouteRetweetParams

type UpdateQouteRetweetParams struct {
	QouteRetweet  bool      `json:"qoute_retweet"`
	PostID        uuid.UUID `json:"post_id"`
	FromAccountID int64     `json:"from_account_id"`
}

type UpdateRetweetParams

type UpdateRetweetParams struct {
	Retweet       bool      `json:"retweet"`
	PostID        uuid.UUID `json:"post_id"`
	FromAccountID int64     `json:"from_account_id"`
}

type User

type User struct {
	Username          string        `json:"username"`
	HashedPassword    string        `json:"hashed_password"`
	FullName          string        `json:"full_name"`
	Email             string        `json:"email"`
	PasswordChangedAt time.Time     `json:"password_changed_at"`
	CreatedAt         time.Time     `json:"created_at"`
	ID                uuid.NullUUID `json:"id"`
}

Jump to

Keyboard shortcuts

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