domain

package
v0.0.0-...-23cec36 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger *slog.Logger) context.Context

func LoggerFromContext

func LoggerFromContext(ctx context.Context) *slog.Logger

Types

type Article

type Article struct {
	HashID      string    `json:"hash_id"`
	Title       string    `json:"title"`
	Link        string    `json:"link"`
	TextStart   string    `json:"text_start"`
	Authors     string    `json:"authors"`
	Source      string    `json:"source"`
	PublishedAt time.Time `json:"published_at"`
}

type ArticleFilters

type ArticleFilters struct {
	SourcesAllowlist []string
	SourcesBlocklist []string
	PublishedAfter   time.Time
	PublishedBefore  time.Time
	TitleFulltext    string
	AuthorsFulltext  string
}

type ArticleListMetadata

type ArticleListMetadata struct {
	TotalRows int `json:"total_rows"`
}

type ArticleListOptions

type ArticleListOptions struct {
	Limit          int64
	Ordering       []ArticleOrdering
	Page, PageSize int
}

type ArticleOrdering

type ArticleOrdering struct {
	Field ArticleOrderingField
	Desc  bool
}

type ArticleOrderingField

type ArticleOrderingField string
const ArticleOrderingFieldAuthors ArticleOrderingField = "authors"
const ArticleOrderingFieldPublishedAt ArticleOrderingField = "published_at"
const ArticleOrderingFieldSource ArticleOrderingField = "source"
const ArticleOrderingFieldTitle ArticleOrderingField = "title"

type SimilarArticle

type SimilarArticle struct {
	HashID string
	Score  float64
}

Jump to

Keyboard shortcuts

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