search

package
v0.0.0-...-f01271b Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 2 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,omitempty"`
	AuthorID    string    `json:"author_id"`
	Slug        string    `json:"slug"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Body        string    `json:"body"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at,omitempty"`
}

type ArticleUpdate

type ArticleUpdate struct {
	ID      string `json:"id"`
	Updates struct {
		Slug        *string   `json:"slug,omitempty"`
		Title       *string   `json:"title,omitempty"`
		Description *string   `json:"description,omitempty"`
		Body        *string   `json:"body,omitempty"`
		UpdatedAt   time.Time `json:"updated_at"`
	}
}

type ArticlesWithCount

type ArticlesWithCount struct {
	Articles []Article `json:"articles"`
	Total    int       `json:"totarticlesCount"`
}

type SearchParams

type SearchParams struct {
	Q       string
	Page    int
	PerPage int
}

type Searcher

type Searcher interface {
	CreateArticle(ctx context.Context, article Article) error
	UpdateArticle(ctx context.Context, article ArticleUpdate) error
	DeleteArticle(ctx context.Context, id string) error
	Search(ctx context.Context, params SearchParams) (*ArticlesWithCount, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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