db

package
v0.0.0-...-fc6f2ac Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectedMediaTypes

func SelectedMediaTypes(mediaTypes []string) map[string]bool

Types

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 HistoriesCategoryRenameParams

type HistoriesCategoryRenameParams struct {
	OldCategory string `json:"old_category"`
	NewCategory string `json:"new_category"`
	Username    string `json:"username"`
}

type History

type History struct {
	Username   string    `json:"username"`
	PostType   PostType  `json:"post_type"`
	PostOwner  string    `json:"post_owner"`
	Post       string    `json:"post"`
	PostDate   time.Time `json:"post_date"`
	Files      []string  `json:"files"`
	Categories []string  `json:"categories"`
	Incognito  bool      `json:"incognito"`
}

type HistoryAddFromArchiveParams

type HistoryAddFromArchiveParams struct {
	Username   string    `json:"username"`
	PostType   PostType  `json:"post_type"`
	PostOwner  string    `json:"post_owner"`
	Post       string    `json:"post"`
	PostDate   time.Time `json:"post_date"`
	Files      []string  `json:"files"`
	Categories []string  `json:"categories"`
}

type HistoryAddParams

type HistoryAddParams struct {
	Username   string   `json:"username"`
	PostType   PostType `json:"post_type"`
	PostOwner  string   `json:"post_owner"`
	Post       string   `json:"post"`
	Files      []string `json:"files"`
	Categories []string `json:"categories"`
}

type HistoryCountByFileParams

type HistoryCountByFileParams struct {
	PostType  PostType `json:"post_type"`
	PostOwner string   `json:"post_owner"`
	File      string   `json:"file"`
	Username  string   `json:"username"`
}

type HistoryCountParams

type HistoryCountParams struct {
	PostTypes      []PostType `json:"post_types"`
	Exclusive      bool       `json:"exclusive"`
	Categories     []string   `json:"categories"`
	UserCategories []string   `json:"user_categories"`
	PostOwners     []string   `json:"post_owners"`
	Username       string     `json:"username"`
}

type HistoryGetByOwnerParams

type HistoryGetByOwnerParams struct {
	PostType  PostType `json:"post_type"`
	PostOwner string   `json:"post_owner"`
	Post      string   `json:"post"`
	Username  string   `json:"username"`
}

type HistoryGetPageParams

type HistoryGetPageParams struct {
	PostTypes      []PostType `json:"post_types"`
	Exclusive      bool       `json:"exclusive"`
	Categories     []string   `json:"categories"`
	UserCategories []string   `json:"user_categories"`
	PostOwners     []string   `json:"post_owners"`
	Username       string     `json:"username"`
	Page           int32      `json:"page"`
	PageSize       int32      `json:"page_size"`
}

type HistoryGetParams

type HistoryGetParams struct {
	PostType PostType `json:"post_type"`
	Post     string   `json:"post"`
	Username string   `json:"username"`
}

type HistoryOwnersParams

type HistoryOwnersParams struct {
	PostTypes      []PostType `json:"post_types"`
	Exclusive      bool       `json:"exclusive"`
	Categories     []string   `json:"categories"`
	UserCategories []string   `json:"user_categories"`
	PostOwner      string     `json:"post_owner"`
	Username       string     `json:"username"`
}

type HistoryOwnersRow

type HistoryOwnersRow struct {
	PostOwner string   `json:"post_owner"`
	PostType  PostType `json:"post_type"`
}

type HistoryRemoveParams

type HistoryRemoveParams struct {
	PostType  PostType `json:"post_type"`
	PostOwner string   `json:"post_owner"`
	Post      string   `json:"post"`
	Username  string   `json:"username"`
}

type HistoryUpdateCategoriesParams

type HistoryUpdateCategoriesParams struct {
	Categories []string `json:"categories"`
	PostType   PostType `json:"post_type"`
	Post       string   `json:"post"`
	PostOwner  string   `json:"post_owner"`
	Username   string   `json:"username"`
}

type HistoryUpdateOwnerParams

type HistoryUpdateOwnerParams struct {
	NewOwner string   `json:"new_owner"`
	PostType PostType `json:"post_type"`
	OldOwner string   `json:"old_owner"`
	Username string   `json:"username"`
}

type NetworkType

type NetworkType string
const (
	NetworkTypeInstagram NetworkType = "instagram"
	NetworkTypeTiktok    NetworkType = "tiktok"
	NetworkTypeVsco      NetworkType = "vsco"
)

func (*NetworkType) Scan

func (e *NetworkType) Scan(src interface{}) error

func (NetworkType) Valid

func (e NetworkType) Valid() bool

type NullNetworkType

type NullNetworkType struct {
	NetworkType NetworkType `json:"network_type"`
	Valid       bool        `json:"valid"` // Valid is true if NetworkType is not NULL
}

func (*NullNetworkType) Scan

func (ns *NullNetworkType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullNetworkType) Value

func (ns NullNetworkType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullPostType

type NullPostType struct {
	PostType PostType `json:"post_type"`
	Valid    bool     `json:"valid"` // Valid is true if PostType is not NULL
}

func (*NullPostType) Scan

func (ns *NullPostType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPostType) Value

func (ns NullPostType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Owner

type Owner struct {
	Owner string `json:"owner"`
	Type  string `json:"type"`
}

type PostType

type PostType string
const (
	PostTypeInstagram PostType = "instagram"
	PostTypeHighlight PostType = "highlight"
	PostTypeStory     PostType = "story"
	PostTypeTiktok    PostType = "tiktok"
	PostTypeVsco      PostType = "vsco"
	PostTypeSnapchat  PostType = "snapchat"
)

func (*PostType) Scan

func (e *PostType) Scan(src interface{}) error

func (PostType) Valid

func (e PostType) Valid() bool

type Querier

type Querier interface {
	HistoriesCategoryRename(ctx context.Context, arg HistoriesCategoryRenameParams) error
	HistoryAdd(ctx context.Context, arg HistoryAddParams) (History, error)
	HistoryAddFromArchive(ctx context.Context, arg HistoryAddFromArchiveParams) (History, error)
	HistoryCount(ctx context.Context, arg HistoryCountParams) (int64, error)
	HistoryCountByFile(ctx context.Context, arg HistoryCountByFileParams) (int64, error)
	HistoryGet(ctx context.Context, arg HistoryGetParams) (History, error)
	HistoryGetByOwner(ctx context.Context, arg HistoryGetByOwnerParams) (History, error)
	// https://docs.sqlc.dev/en/stable/howto/select.html#passing-a-slice-as-a-parameter-to-a-query
	// https://docs.sqlc.dev/en/stable/howto/named_parameters.html
	HistoryGetPage(ctx context.Context, arg HistoryGetPageParams) ([]History, error)
	HistoryOwners(ctx context.Context, arg HistoryOwnersParams) ([]HistoryOwnersRow, error)
	HistoryRemove(ctx context.Context, arg HistoryRemoveParams) error
	HistoryUpdateCategories(ctx context.Context, arg HistoryUpdateCategoriesParams) (History, error)
	HistoryUpdateOwner(ctx context.Context, arg HistoryUpdateOwnerParams) error
	UpdateHistoryRemoveFile(ctx context.Context, arg UpdateHistoryRemoveFileParams) (History, error)
	UserAdd(ctx context.Context, arg UserAddParams) error
	UserCategoryAdd(ctx context.Context, arg UserCategoryAddParams) error
	UserCategoryRemove(ctx context.Context, arg UserCategoryRemoveParams) error
	UserGet(ctx context.Context, username string) (User, error)
	UserUpdateHash(ctx context.Context, arg UserUpdateHashParams) error
	UserUpdateInstagramSession(ctx context.Context, arg UserUpdateInstagramSessionParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) HistoriesCategoryRename

func (q *Queries) HistoriesCategoryRename(ctx context.Context, arg HistoriesCategoryRenameParams) error

func (*Queries) HistoryAdd

func (q *Queries) HistoryAdd(ctx context.Context, arg HistoryAddParams) (History, error)

func (*Queries) HistoryAddFromArchive

func (q *Queries) HistoryAddFromArchive(ctx context.Context, arg HistoryAddFromArchiveParams) (History, error)

func (*Queries) HistoryCount

func (q *Queries) HistoryCount(ctx context.Context, arg HistoryCountParams) (int64, error)

func (*Queries) HistoryCountByFile

func (q *Queries) HistoryCountByFile(ctx context.Context, arg HistoryCountByFileParams) (int64, error)

func (*Queries) HistoryGet

func (q *Queries) HistoryGet(ctx context.Context, arg HistoryGetParams) (History, error)

func (*Queries) HistoryGetByOwner

func (q *Queries) HistoryGetByOwner(ctx context.Context, arg HistoryGetByOwnerParams) (History, error)

func (*Queries) HistoryOwners

func (q *Queries) HistoryOwners(ctx context.Context, arg HistoryOwnersParams) ([]HistoryOwnersRow, error)

func (*Queries) HistoryRemove

func (q *Queries) HistoryRemove(ctx context.Context, arg HistoryRemoveParams) error

func (*Queries) HistoryUpdateCategories

func (q *Queries) HistoryUpdateCategories(ctx context.Context, arg HistoryUpdateCategoriesParams) (History, error)

func (*Queries) HistoryUpdateOwner

func (q *Queries) HistoryUpdateOwner(ctx context.Context, arg HistoryUpdateOwnerParams) error

func (*Queries) UpdateHistoryRemoveFile

func (q *Queries) UpdateHistoryRemoveFile(ctx context.Context, arg UpdateHistoryRemoveFileParams) (History, error)

func (*Queries) UserAdd

func (q *Queries) UserAdd(ctx context.Context, arg UserAddParams) error

func (*Queries) UserCategoryAdd

func (q *Queries) UserCategoryAdd(ctx context.Context, arg UserCategoryAddParams) error

func (*Queries) UserCategoryRemove

func (q *Queries) UserCategoryRemove(ctx context.Context, arg UserCategoryRemoveParams) error

func (*Queries) UserGet

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

func (*Queries) UserUpdateHash

func (q *Queries) UserUpdateHash(ctx context.Context, arg UserUpdateHashParams) error

func (*Queries) UserUpdateInstagramSession

func (q *Queries) UserUpdateInstagramSession(ctx context.Context, arg UserUpdateInstagramSessionParams) error

func (*Queries) WithTx

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

type UpdateHistoryRemoveFileParams

type UpdateHistoryRemoveFileParams struct {
	File      string   `json:"file"`
	PostType  PostType `json:"post_type"`
	Post      string   `json:"post"`
	PostOwner string   `json:"post_owner"`
	Username  string   `json:"username"`
}

type User

type User struct {
	Username             string      `json:"username"`
	PasswordHash         string      `json:"password_hash"`
	InstagramSessionID   string      `json:"instagram_session_id"`
	InstagramUserID      string      `json:"instagram_user_id"`
	Network              NetworkType `json:"network"`
	Categories           []string    `json:"categories"`
	TiktokSessionID      string      `json:"tiktok_session_id"`
	TiktokSessionIDGuard string      `json:"tiktok_session_id_guard"`
}

func (*User) SelectedCategories

func (user *User) SelectedCategories(categories []string) map[string]bool

type UserAddParams

type UserAddParams struct {
	Username           string   `json:"username"`
	PasswordHash       string   `json:"password_hash"`
	InstagramSessionID string   `json:"instagram_session_id"`
	InstagramUserID    string   `json:"instagram_user_id"`
	Categories         []string `json:"categories"`
}

type UserCategoryAddParams

type UserCategoryAddParams struct {
	Category string `json:"category"`
	Username string `json:"username"`
}

type UserCategoryRemoveParams

type UserCategoryRemoveParams struct {
	Category string `json:"category"`
	Username string `json:"username"`
}

type UserUpdateHashParams

type UserUpdateHashParams struct {
	PasswordHash string `json:"password_hash"`
	Username     string `json:"username"`
}

type UserUpdateInstagramSessionParams

type UserUpdateInstagramSessionParams struct {
	InstagramSessionID string `json:"instagram_session_id"`
	InstagramUserID    string `json:"instagram_user_id"`
	PasswordHash       string `json:"password_hash"`
	Username           string `json:"username"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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