Version: v0.0.0-...-2efcb5c Latest Latest

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 28 Imported by: 0




This section is empty.


View Source
var ErrNoName = errors.New("no name to find")


func ParseTemplates

func ParseTemplates(webPath string) (*template.Template, error)


type Blog

type Blog struct {
	// contains filtered or unexported fields

func New

func New(
	config Config,
	db *sql.DB,
	templates *template.Template,
	hubPublisher HubPublisher,
	silos []interface{},
) (*Blog, error)

func (*Blog) BaseURL

func (b *Blog) BaseURL() string

func (*Blog) Before

func (b *Blog) Before(published time.Time) (groups []numbersix.Group, err error)

func (*Blog) CategoryBefore

func (b *Blog) CategoryBefore(category string, published time.Time) (groups []numbersix.Group, err error)

func (*Blog) Close

func (b *Blog) Close() error

func (*Blog) Create

func (b *Blog) Create(data map[string][]interface{}) (string, error)

func (*Blog) Delete

func (b *Blog) Delete(url string) error

func (*Blog) Entry

func (b *Blog) Entry(url string) (data map[string][]interface{}, err error)

func (*Blog) EntryByUID

func (b *Blog) EntryByUID(uid string) (data map[string][]interface{}, err error)

func (*Blog) Handler

func (b *Blog) Handler() http.Handler

func (*Blog) KindBefore

func (b *Blog) KindBefore(kind string, published time.Time) (groups []numbersix.Group, err error)

func (*Blog) LikesOn

func (b *Blog) LikesOn(ymd string) (groups []numbersix.Group, err error)

func (*Blog) Mention

func (b *Blog) Mention(source string, data map[string][]interface{}) error

func (*Blog) MentionsBefore

func (b *Blog) MentionsBefore(published time.Time, limit int) (list []numbersix.Group, err error)

func (*Blog) MentionsForEntry

func (b *Blog) MentionsForEntry(url string) (list []numbersix.Group, err error)

func (*Blog) Undelete

func (b *Blog) Undelete(url string) error

func (*Blog) Update

func (b *Blog) Update(
	url string,
	replace, add, delete map[string][]interface{},
	deleteAll []string,
) error

type CardResolver

type CardResolver interface {
	ResolveCard(string) (map[string]interface{}, error)

type CiteResolver

type CiteResolver interface {
	ResolveCite(string) (map[string]interface{}, error)

type Config

type Config struct {
	Me          string
	Name        string
	Title       string
	Description string
	BaseURL     *url.URL
	MediaURL    *url.URL
	DbPath      string
	MediaDir    string
	HubURL      string

type FileWriter

type FileWriter struct {
	// MediaDir is the directory to write files to.
	MediaDir string

	// MediaURL is the base URL files will be accessed from.
	MediaURL *url.URL

func (*FileWriter) WriteFile

func (fw *FileWriter) WriteFile(name, contentType string, r io.Reader) (location string, err error)

type GroupedPosts

type GroupedPosts struct {
	Type  string
	Posts []map[string][]interface{}
	Meta  map[string][]interface{}

type HubPublisher

type HubPublisher interface {
	Publish(topic string) error

type HubStore

type HubStore struct {
	// contains filtered or unexported fields

func NewHubStore

func NewHubStore(db *sql.DB) (*HubStore, error)

func (*HubStore) Subscribe

func (h *HubStore) Subscribe(callback, topic string, expiresAt time.Time, secret string) error

func (*HubStore) Subscribers

func (h *HubStore) Subscribers(topic string) (websub.SubscribersIter, error)

func (*HubStore) Unsubscribe

func (h *HubStore) Unsubscribe(callback, topic string) error

type SubscribersIter

type SubscribersIter struct {
	// contains filtered or unexported fields

func (*SubscribersIter) Close

func (s *SubscribersIter) Close() error

func (*SubscribersIter) Data

func (s *SubscribersIter) Data() (callback, secret string, err error)

func (*SubscribersIter) Err

func (s *SubscribersIter) Err() error

func (*SubscribersIter) Next

func (s *SubscribersIter) Next() bool

type Syndicator

type Syndicator interface {
	Create(data map[string][]interface{}) (location string, err error)
	UID() string
	Name() string

Jump to

Keyboard shortcuts

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