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

internal

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 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 Article

type Article struct {
	ID             string     `json:"id"`
	Slug           string     `json:"slug"`
	Title          string     `json:"title"`
	Author         string     `json:"author"`
	Subtitle       *string    `json:"subtitle"`
	ReadingMinutes *int64     `json:"reading_minutes"`
	LastViewedMs   *int64     `json:"last_viewed_ms"`
	Rating         *float64   `json:"rating"`
	CoverImage     []byte     `json:"cover_image"`
	PublishedAt    *time.Time `json:"published_at"`
	Metadata       *string    `json:"metadata"`
	IsFeatured     int64      `json:"is_featured"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
}

type CreateArticleParams

type CreateArticleParams struct {
	ID             string     `json:"id"`
	Slug           string     `json:"slug"`
	Title          string     `json:"title"`
	Author         string     `json:"author"`
	Subtitle       *string    `json:"subtitle"`
	ReadingMinutes *int64     `json:"reading_minutes"`
	LastViewedMs   *int64     `json:"last_viewed_ms"`
	Rating         *float64   `json:"rating"`
	CoverImage     []byte     `json:"cover_image"`
	PublishedAt    *time.Time `json:"published_at"`
	Metadata       *string    `json:"metadata"`
	IsFeatured     int64      `json:"is_featured"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
}

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 ListArticleByAuthorParams added in v0.0.4

type ListArticleByAuthorParams struct {
	Author string `json:"author"`
	Offset int64  `json:"offset"`
	Limit  int64  `json:"limit"`
}

type ListArticleFilterByAuthorIsFeaturedPublishedAtTitleParams

type ListArticleFilterByAuthorIsFeaturedPublishedAtTitleParams struct {
	Author         string     `json:"author"`
	IsFeatured     int64      `json:"is_featured"`
	MinPublishedAt *time.Time `json:"min_published_at"`
	MaxPublishedAt *time.Time `json:"max_published_at"`
	Title          string     `json:"title"`
	Offset         int64      `json:"offset"`
	Limit          int64      `json:"limit"`
}

type ListArticleFilterByAuthorIsFeaturedPublishedAtTitleRow added in v0.0.5

type ListArticleFilterByAuthorIsFeaturedPublishedAtTitleRow struct {
	ID             string     `json:"id"`
	Slug           string     `json:"slug"`
	Title          string     `json:"title"`
	Author         string     `json:"author"`
	Subtitle       *string    `json:"subtitle"`
	ReadingMinutes *int64     `json:"reading_minutes"`
	LastViewedMs   *int64     `json:"last_viewed_ms"`
	Rating         *float64   `json:"rating"`
	CoverImage     []byte     `json:"cover_image"`
	PublishedAt    *time.Time `json:"published_at"`
	Metadata       *string    `json:"metadata"`
	IsFeatured     int64      `json:"is_featured"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	TotalSize      int64      `json:"total_size"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateArticle

func (q *Queries) CreateArticle(ctx context.Context, arg CreateArticleParams) (string, error)

Code generated by entlite. DO NOT EDIT. SQLC compatible query definitions Article CRUD operations re-posting a slug keeps the article that is already there, the caller gets sql.ErrNoRows because nothing was inserted

func (*Queries) DB

func (q *Queries) DB() DBTX

DB returns the handle this Queries was constructed with.

func (*Queries) DeleteArticle

func (q *Queries) DeleteArticle(ctx context.Context, id string) error

func (*Queries) GetArticleById added in v0.0.6

func (q *Queries) GetArticleById(ctx context.Context, id string) (Article, error)

func (*Queries) GetArticleBySlug

func (q *Queries) GetArticleBySlug(ctx context.Context, slug string) (Article, error)

func (*Queries) ListAllArticle

func (q *Queries) ListAllArticle(ctx context.Context) ([]Article, error)

func (*Queries) ListArticleByAuthor

func (q *Queries) ListArticleByAuthor(ctx context.Context, arg ListArticleByAuthorParams) ([]Article, error)

func (*Queries) UpdateArticle

func (q *Queries) UpdateArticle(ctx context.Context, arg UpdateArticleParams) (Article, error)

func (*Queries) WithTx

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

type UpdateArticleParams

type UpdateArticleParams struct {
	Slug           string     `json:"slug"`
	Title          string     `json:"title"`
	Author         string     `json:"author"`
	Subtitle       *string    `json:"subtitle"`
	ReadingMinutes *int64     `json:"reading_minutes"`
	LastViewedMs   *int64     `json:"last_viewed_ms"`
	Rating         *float64   `json:"rating"`
	CoverImage     []byte     `json:"cover_image"`
	PublishedAt    *time.Time `json:"published_at"`
	Metadata       *string    `json:"metadata"`
	IsFeatured     *int64     `json:"is_featured"`
	UpdatedAt      time.Time  `json:"updated_at"`
	ID             string     `json:"id"`
}

Jump to

Keyboard shortcuts

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