news

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Title = int(core.Qt__UserRole) + 1<<iota
	Text
	Date
	Year
	Link
)

Model Roles.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	core.QObject

	Title string
	Text  string
	Date  string
	Year  string
	Link  string
}

Item represents a news item in the model.

type JSONItem

type JSONItem struct {
	Title string `json:"title"`
	Text  string `json:"text"`
	Date  string `json:"date"`
	Year  string `json:"year"`
	Link  string `json:"link"`
}

JSONItem represents a news item from JSON, before it's turned into a model item.

type Model

type Model struct {
	core.QAbstractListModel
	// contains filtered or unexported fields
}

Model is the news model used for news items.

type Service

type Service interface {
	SetNewsItems() error
}

Service is responsible for all things related to the news.

func NewService

func NewService(
	client slashdiablo.Client,
	newsModel *Model,
) Service

NewService returns a service with all the dependencies.

Jump to

Keyboard shortcuts

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