model

package
v2.0.0-beta9 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 5 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         uuid.UUID `json:"id,omitempty"`
	SiteID     uuid.UUID `json:"site_id,omitempty"`
	Lang       string    `json:"lang,omitempty"`
	Title      string    `json:"title,omitempty"`
	ShortDesc  string    `json:"short_desc,omitempty"`
	Link       string    `json:"link,omitempty"`
	Image      string    `json:"image,omitempty"`
	PubDate    time.Time `json:"pub_date,omitempty"`
	PubDiff    string    `json:"pub_diff,omitempty"`
	Categories []string  `json:"categories,omitempty"`
}

func ArticleFromEntity

func ArticleFromEntity(e *entity.Article) Article

type Message

type Message struct {
	ChatID   int64  `json:"chat_id,omitempty"`
	ImageURL string `json:"image_url,omitempty"`
	View     View   `json:"view,omitempty"`
	Data     any    `json:"data,omitempty"`
	Delay    bool   `json:"delay,omitempty"`
}

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

type Render

type Render func(view View, data any) (string, error)

type View

type View string
const (
	ViewAppStart View = "appstart.html"
	ViewAppStop  View = "appstop.html"
	ViewArticles View = "articles.html"
	ViewArticle  View = "article.html"
	ViewChat     View = "chat.html"
	ViewSites    View = "sites.html"
	ViewSub      View = "sub.html"
	ViewSuccess  View = "success.html"
	ViewError    View = "error.html"
	ViewNotFound View = "notfound.html"
)

Jump to

Keyboard shortcuts

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