feed

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

* Copyright (c) 2016 The ConnectorDB Contributors Licensed under the MIT license. *

* Copyright (c) 2016 The ConnectorDB Contributors Licensed under the MIT license. *

Index

Constants

This section is empty.

Variables

View Source
var (
	//EntryLimit is the maximum number of entries that the feeds will display at one time
	EntryLimit = int64(500)
)

Functions

func AtomTime

func AtomTime(t time.Time) string

func GetAtom

func GetAtom(o *authoperator.AuthOperator, writer http.ResponseWriter, request *http.Request, logger *log.Entry) (int, string)

GetAtom gets an Atom feed of the given stream.

func Router

func Router(db *connectordb.Database, prefix *mux.Router) *mux.Router

Router returns a fully formed Gorilla router given an optional prefix

Types

type Entry

type Entry struct {
	Title   string  `xml:"title"`
	ID      string  `xml:"id"`
	Link    Link    `xml:"link"`
	Updated string  `xml:"updated"`
	Author  *Person `xml:"author"`
	Content *Text   `xml:"content"`
}

type Feed

type Feed struct {
	XMLName xml.Name `xml:"http://www.w3.org/2005/Atom feed"`
	Title   string   `xml:"title"`
	ID      string   `xml:"id"`
	Link    Link     `xml:"link"`
	Updated string   `xml:"updated"`
	Author  *Person  `xml:"author"`
	Entry   []*Entry `xml:"entry"`
}
type Link struct {
	Href string `xml:"href,attr"`
	Rel  string `xml:"rel,attr,omitempty"`
}

type Person

type Person struct {
	Name string `xml:"name"`
}

type Text

type Text struct {
	Type string `xml:"type,attr,omitempty"`
	Body string `xml:",chardata"`
}

Jump to

Keyboard shortcuts

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