controller

package
v0.0.0-...-1a79bca Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GenerateArticles() error
	GetArticles() []models.Article
}

type Articles

type Articles struct {
	ArticleView *articles.View
	// contains filtered or unexported fields
}

func NewArticleController

func NewArticleController(db *models.ArticleDB, v *articles.View, numberOfArticles int, logger *log.Logger, api ...API) Articles

func (*Articles) CaptureArticles

func (a *Articles) CaptureArticles()

CaptureArticles will be called by RunPeriodicCapture at every constant time period. This is exported for debugging purposes in main.go

func (*Articles) CaptureTags

func (a *Articles) CaptureTags()

func (*Articles) GetArticles

func (a *Articles) GetArticles(w http.ResponseWriter, r *http.Request)

func (*Articles) GetSections

func (a *Articles) GetSections(w http.ResponseWriter, _ *http.Request)

func (*Articles) GetTags

func (a *Articles) GetTags(w http.ResponseWriter, _ *http.Request)

func (*Articles) RunPeriodicCapture

func (a *Articles) RunPeriodicCapture(interval int)

Continuously running until the program exits.

func (*Articles) ShowArticles

func (a *Articles) ShowArticles(w http.ResponseWriter, _ *http.Request)

func (*Articles) SummariseArticle

func (a *Articles) SummariseArticle(article models.Article)

Jump to

Keyboard shortcuts

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