Help us shape the future of Go! Take the 2026 Go Developer Survey

db

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CountMedia = `` /* 1248-byte string literal not displayed */
View Source
const CreateMedia = `` /* 427-byte string literal not displayed */
View Source
const DeleteMedia = `` /* 215-byte string literal not displayed */
View Source
const GetMedia = `` /* 236-byte string literal not displayed */
View Source
const GetSetting = `-- name: GetSetting :one

SELECT s.value FROM core_settings s WHERE s.key = ?1
`
View Source
const GetUserSetting = `-- name: GetUserSetting :one

SELECT u.value FROM core_user_settings u WHERE u.user_id = ?1 AND u.key = ?2
`
View Source
const ListMedia = `` /* 2478-byte string literal not displayed */
View Source
const ListMediaByIDs = `` /* 289-byte string literal not displayed */
View Source
const ListSavedMediaFiles = `` /* 131-byte string literal not displayed */
View Source
const SetSetting = `` /* 136-byte string literal not displayed */
View Source
const SetUserSetting = `` /* 167-byte string literal not displayed */
View Source
const UpdateMedia = `` /* 313-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthUser

type AuthUser struct {
	ID   uuid.UUID
	Name string
}

type CoreContent

type CoreContent struct {
	ID          string
	Type        string
	Status      string
	Slug        string
	Title       string
	Content     string
	Excerpt     string
	AuthorID    string
	PublishedAt *int64
	CreatedAt   int64
	UpdatedAt   int64
	ParentID    *string
	Path        string
	Fields      string
}

type CoreContentField

type CoreContentField struct {
	ID            int64
	Key           string
	Label         string
	Kind          string
	RelatesTo     *string
	Many          bool
	Required      bool
	CreatedAt     int64
	UpdatedAt     int64
	Position      int64
	GroupID       int64
	Settings      string
	ParentFieldID *int64
	Depth         int64
	Origin        *string
}

type CoreContentRelation

type CoreContentRelation struct {
	FromID   string
	FieldID  int64
	ToID     string
	Position int64
	SortAt   int64
	Visible  bool
}

type CoreContentRevision

type CoreContentRevision struct {
	ID        string
	ContentID string
	Kind      string
	AuthorID  string
	Title     string
	Content   string
	Excerpt   string
	CreatedAt int64
	Fields    string
}

type CoreContentType

type CoreContentType struct {
	Key           string
	SingularLabel string
	PluralLabel   string
	RouteWord     string
	Hierarchical  bool
	Revisions     bool
	RevisionCap   int64
	PageKind      string
	IsDefault     bool
	Active        bool
	CreatedAt     int64
	UpdatedAt     int64
	Origin        *string
	Description   string
}

type CoreCronJob

type CoreCronJob struct {
	Name           string
	NextRunAt      int64
	LeasedUntil    *int64
	LeaseToken     *string
	LastStartedAt  *int64
	LastFinishedAt *int64
	LastError      *string
}

type CoreFieldGroup

type CoreFieldGroup struct {
	ID        int64
	Title     string
	Location  string
	Position  int64
	Active    bool
	CreatedAt int64
	UpdatedAt int64
	Origin    *string
	Key       string
}

type CoreMedia

type CoreMedia struct {
	ID          int64
	MediaType   string
	File        string
	Title       string
	AltText     string
	Caption     string
	Description string
	MimeType    string
	Width       int64
	Height      int64
	Filesize    int64
	Sizes       columns.Sizes
	AuthorID    uuid.UUID
	CreatedAt   dbkit.Time
	UpdatedAt   dbkit.Time
}

type CoreSetting

type CoreSetting struct {
	Key   string
	Value string
}

type CoreUserSetting

type CoreUserSetting struct {
	UserID uuid.UUID
	Key    string
	Value  string
}

type CountMediaParams

type CountMediaParams struct {
	MediaType       string
	Mimes           string
	Authors         string
	ExcludedAuthors string
	Before          *time.Time
	After           *time.Time
	ModifiedBefore  *time.Time
	ModifiedAfter   *time.Time
	Search          string
}

type CreateMediaParams

type CreateMediaParams struct {
	MediaType   string
	File        string
	Title       string
	AltText     string
	Caption     string
	Description string
	MimeType    string
	Width       int64
	Height      int64
	Filesize    int64
	Sizes       columns.Sizes
	AuthorID    uuid.UUID
	CreatedAt   dbkit.Time
	UpdatedAt   dbkit.Time
}

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 GetUserSettingParams

type GetUserSettingParams struct {
	UserID uuid.UUID
	Key    string
}

type ListMediaParams

type ListMediaParams struct {
	MediaType       string
	Mimes           string
	Authors         string
	ExcludedAuthors string
	Before          *time.Time
	After           *time.Time
	ModifiedBefore  *time.Time
	ModifiedAfter   *time.Time
	Search          string
	RowOffset       int64
	RowLimit        int64
	OrderBy         string
	OrderDir        string
}

type ListMediaRow

type ListMediaRow struct {
	CoreMedia  CoreMedia
	AuthorName string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountMedia

func (q *Queries) CountMedia(ctx context.Context, arg CountMediaParams) (int64, error)

func (*Queries) CreateMedia

func (q *Queries) CreateMedia(ctx context.Context, arg CreateMediaParams) (CoreMedia, error)

SPDX-License-Identifier: Apache-2.0

func (*Queries) DeleteMedia

func (q *Queries) DeleteMedia(ctx context.Context, id int64) (CoreMedia, error)

func (*Queries) GetMedia

func (q *Queries) GetMedia(ctx context.Context, id int64) (CoreMedia, error)

func (*Queries) GetSetting

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

SPDX-License-Identifier: Apache-2.0

func (*Queries) GetUserSetting

func (q *Queries) GetUserSetting(ctx context.Context, arg GetUserSettingParams) (string, error)

SPDX-License-Identifier: Apache-2.0

func (*Queries) ListMedia

func (q *Queries) ListMedia(ctx context.Context, arg ListMediaParams) ([]ListMediaRow, error)

func (*Queries) ListMediaByIDs

func (q *Queries) ListMediaByIDs(ctx context.Context, ids string) ([]CoreMedia, error)

func (*Queries) ListSavedMediaFiles

func (q *Queries) ListSavedMediaFiles(ctx context.Context, files string) ([]string, error)

func (*Queries) SetSetting

func (q *Queries) SetSetting(ctx context.Context, arg SetSettingParams) error

func (*Queries) SetUserSetting

func (q *Queries) SetUserSetting(ctx context.Context, arg SetUserSettingParams) error

func (*Queries) UpdateMedia

func (q *Queries) UpdateMedia(ctx context.Context, arg UpdateMediaParams) (CoreMedia, error)

func (*Queries) WithTx

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

type SetSettingParams

type SetSettingParams struct {
	Key   string
	Value string
}

type SetUserSettingParams

type SetUserSettingParams struct {
	UserID uuid.UUID
	Key    string
	Value  string
}

type UpdateMediaParams

type UpdateMediaParams struct {
	Title             string
	AltText           string
	Caption           string
	Description       string
	UpdatedAt         dbkit.Time
	ID                int64
	ExpectedUpdatedAt dbkit.Time
}

Jump to

Keyboard shortcuts

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