db

package
v0.0.0-...-60dd0c8 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	ContentID int64
	FileID    int64
	Encoding  string
	Body      []byte
}

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 File

type File struct {
	FileID       int64
	UrlID        int64
	ContentType  string
	LastModified int64
	Title        string
	Etag         string
	Headers      []byte
}

type GetFileRow

type GetFileRow struct {
	File    File
	Content Content
}

type InsertContentParams

type InsertContentParams struct {
	Fileid   int64
	Encoding string
	Body     []byte
}

type InsertFileParams

type InsertFileParams struct {
	UrlID        int64
	ContentType  string
	LastModified int64
	Etag         string
	Title        string
	Headers      []byte
}

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

func (q *Queries) CheckPath(ctx context.Context, path string) (int64, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) GetFile

func (q *Queries) GetFile(ctx context.Context, path string) ([]GetFileRow, error)

func (*Queries) InsertContent

func (q *Queries) InsertContent(ctx context.Context, arg InsertContentParams) error

func (*Queries) InsertFile

func (q *Queries) InsertFile(ctx context.Context, arg InsertFileParams) (int64, error)

func (*Queries) InsertURL

func (q *Queries) InsertURL(ctx context.Context, path string) (int64, error)

func (*Queries) WithTx

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

type Url

type Url struct {
	UrlID int64
	Path  string
}

Jump to

Keyboard shortcuts

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