db

package
v0.0.0-...-266ee84 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 History

type History struct {
	Username   string    `json:"username"`
	Type       PostType  `json:"type"`
	Owner      string    `json:"owner"`
	Post       string    `json:"post"`
	Date       time.Time `json:"date"`
	Files      []string  `json:"files"`
	Categories []string  `json:"categories"`
}

type HistoryAddParams

type HistoryAddParams struct {
	Username   string   `json:"username"`
	Type       PostType `json:"type"`
	Owner      string   `json:"owner"`
	Post       string   `json:"post"`
	Files      []string `json:"files"`
	Categories []string `json:"categories"`
}

type HistoryGetExclusiveParams

type HistoryGetExclusiveParams struct {
	Types      []PostType `json:"types"`
	Categories []string   `json:"categories"`
	Owner      string     `json:"owner"`
	Username   string     `json:"username"`
	Page       int32      `json:"page"`
	PageSize   int32      `json:"page_size"`
}

type HistoryGetInclusiveParams

type HistoryGetInclusiveParams struct {
	Types      []PostType `json:"types"`
	Categories []string   `json:"categories"`
	Owner      string     `json:"owner"`
	Username   string     `json:"username"`
	Page       int32      `json:"page"`
	PageSize   int32      `json:"page_size"`
}

type HistoryGetParams

type HistoryGetParams struct {
	Type     PostType `json:"type"`
	Post     string   `json:"post"`
	Username string   `json:"username"`
	Page     int32    `json:"page"`
	PageSize int32    `json:"page_size"`
}

type HistoryRemoveParams

type HistoryRemoveParams struct {
	Type     PostType `json:"type"`
	Owner    string   `json:"owner"`
	Post     string   `json:"post"`
	Username string   `json:"username"`
}

type HistoryUpdateCategoriesParams

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

type HistoryUpdateOwnerParams

type HistoryUpdateOwnerParams struct {
	OldOwner string   `json:"old_owner"`
	Type     PostType `json:"type"`
	NewOwner string   `json:"new_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"
)

func (*PostType) Scan

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

func (PostType) Valid

func (e PostType) Valid() bool

type Querier

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) HistoryAdd

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

func (*Queries) HistoryGet

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

func (*Queries) HistoryGetExclusive

func (q *Queries) HistoryGetExclusive(ctx context.Context, arg HistoryGetExclusiveParams) ([]History, 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) 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) 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) UserUser

func (q *Queries) UserUser(ctx context.Context, arg UserUserParams) error

func (*Queries) WithTx

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

type UpdateHistoryRemoveFileParams

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

type User

type User struct {
	Username           string      `json:"username"`
	Hash               string      `json:"hash"`
	InstagramSessionID string      `json:"instagram_session_id"`
	InstagramUserID    string      `json:"instagram_user_id"`
	Network            NetworkType `json:"network"`
	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 {
	Hash     string `json:"hash"`
	Username string `json:"username"`
}

type UserUpdateInstagramSessionParams

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

type UserUserParams

type UserUserParams struct {
	Username           string   `json:"username"`
	Hash               string   `json:"hash"`
	InstagramSessionID string   `json:"instagram_session_id"`
	InstagramUserID    string   `json:"instagram_user_id"`
	Categories         []string `json:"categories"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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