eagle

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 61 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetsDirectory  string = "assets"
	ContentDirectory string = "content"
)
View Source
const (
	TemplatesExtension string = ".html"
	TemplatesDirectory string = "templates"

	TemplateBase      string = "base"
	TemplateSingle    string = "single"
	TemplateFeed      string = "feed"
	TemplateList      string = "list"
	TemplateError     string = "error"
	TemplateLogin     string = "login"
	TemplateSearch    string = "search"
	TemplateEditor    string = "editor"
	TemplateNew       string = "new"
	TemplateIndex     string = "index"
	TemplateTags      string = "tags"
	TemplateEmojis    string = "emojis"
	TemplateAuth      string = "auth"
	TemplateDashboard string = "dashboard"
	TemplateBook      string = "book"
)
View Source
const (
	AssetsBaseURL string = "/assets"
)
View Source
const ReadsSummary = "_summary.reads.json"
View Source
const WatchesSummary = "_summary.watches.json"

Variables

This section is empty.

Functions

func EntryTemplates

func EntryTemplates(ee *entry.Entry) []string

Types

type Alternate

type Alternate struct {
	Type string
	Href string
}

type Asset

type Asset struct {
	Type string
	Path string
	Body []byte
}

type Assets

type Assets struct {
	// contains filtered or unexported fields
}

func (*Assets) Get

func (a *Assets) Get(id string) *Asset

func (*Assets) Path

func (a *Assets) Path(id string) string

type CacheScope

type CacheScope string
const (
	CacheRegular CacheScope = "reg"
	CacheTor     CacheScope = "tor"
)

type Eagle

type Eagle struct {
	notifier.Notifier

	Parser *entry.Parser
	Config *config.Config
	// contains filtered or unexported fields
}

func NewEagle

func NewEagle(conf *config.Config) (*Eagle, error)

func (*Eagle) AbsoluteURL

func (e *Eagle) AbsoluteURL(path string) string

func (*Eagle) Close

func (e *Eagle) Close()

func (*Eagle) DeduceSections

func (e *Eagle) DeduceSections(entry *entry.Entry) error

func (*Eagle) FetchLastfmScrobbles

func (e *Eagle) FetchLastfmScrobbles(year int, month time.Month, day int) error

func (*Eagle) GenerateDescription

func (e *Eagle) GenerateDescription(ee *entry.Entry, force bool) error

func (*Eagle) GetAll

func (e *Eagle) GetAll(opts *database.QueryOptions) ([]*entry.Entry, error)

func (*Eagle) GetAssets

func (e *Eagle) GetAssets() *Assets

func (*Eagle) GetByDate

func (e *Eagle) GetByDate(opts *database.QueryOptions, year, month, day int) ([]*entry.Entry, error)

func (*Eagle) GetByEmoji

func (e *Eagle) GetByEmoji(opts *database.QueryOptions, emoji string) ([]*entry.Entry, error)

func (*Eagle) GetByProperty

func (e *Eagle) GetByProperty(opts *database.QueryOptions, property, value string) ([]*entry.Entry, error)

func (*Eagle) GetBySection

func (e *Eagle) GetBySection(opts *database.QueryOptions, sections ...string) ([]*entry.Entry, error)

func (*Eagle) GetByTag

func (e *Eagle) GetByTag(opts *database.QueryOptions, tag string) ([]*entry.Entry, error)

func (*Eagle) GetDeleted

func (e *Eagle) GetDeleted(opts *database.PaginationOptions) ([]*entry.Entry, error)

func (*Eagle) GetDrafts

func (e *Eagle) GetDrafts(opts *database.PaginationOptions) ([]*entry.Entry, error)

func (*Eagle) GetEmojis

func (e *Eagle) GetEmojis() ([]string, error)

func (*Eagle) GetEntries

func (e *Eagle) GetEntries(includeList bool) ([]*entry.Entry, error)

func (*Eagle) GetEntry

func (e *Eagle) GetEntry(id string) (*entry.Entry, error)

func (*Eagle) GetPrivate

func (e *Eagle) GetPrivate(opts *database.PaginationOptions, audience string) ([]*entry.Entry, error)

func (*Eagle) GetRedirects

func (e *Eagle) GetRedirects() map[string]string

func (*Eagle) GetSidecar

func (e *Eagle) GetSidecar(entry *entry.Entry) (*Sidecar, error)

func (*Eagle) GetSyndicators

func (e *Eagle) GetSyndicators() []*syndicator.Config

func (*Eagle) GetTags

func (e *Eagle) GetTags() ([]string, error)

func (*Eagle) GetUnlisted

func (e *Eagle) GetUnlisted(opts *database.PaginationOptions) ([]*entry.Entry, error)

func (*Eagle) GetWebmentionTargets

func (e *Eagle) GetWebmentionTargets(entry *entry.Entry) ([]string, []string, []string, error)

func (*Eagle) IsCached

func (e *Eagle) IsCached(scope CacheScope, filename string) ([]byte, time.Time, bool)

func (*Eagle) MakeMonthlyScrobblesReport

func (e *Eagle) MakeMonthlyScrobblesReport(year int, month time.Month) error

func (*Eagle) MakeYearlyScrobblesReport

func (e *Eagle) MakeYearlyScrobblesReport(year int) error

func (*Eagle) PostSaveEntry

func (e *Eagle) PostSaveEntry(ee *entry.Entry, syndicators []string)

func (*Eagle) PreCreateEntry

func (e *Eagle) PreCreateEntry(ee *entry.Entry) error

func (*Eagle) ProcessLocation

func (e *Eagle) ProcessLocation(ee *entry.Entry) error

func (*Eagle) ProcessLocationMap

func (e *Eagle) ProcessLocationMap(ee *entry.Entry) error

func (*Eagle) PurgeCache

func (e *Eagle) PurgeCache(filename string)

func (*Eagle) ReceiveWebmentions

func (e *Eagle) ReceiveWebmentions(payload *WebmentionPayload) error

func (*Eagle) RemoveCache

func (e *Eagle) RemoveCache(ee *entry.Entry)

func (*Eagle) Render

func (e *Eagle) Render(w io.Writer, data *RenderData, tpls []string) error

func (*Eagle) ResetCache

func (e *Eagle) ResetCache()

func (*Eagle) SaveCache

func (e *Eagle) SaveCache(scope CacheScope, filename string, data []byte, modtime time.Time)

func (*Eagle) SaveEntry

func (e *Eagle) SaveEntry(entry *entry.Entry) error

func (*Eagle) Search

func (e *Eagle) Search(opts *database.QueryOptions, query string) ([]*entry.Entry, error)

func (*Eagle) SendWebmentions

func (e *Eagle) SendWebmentions(entry *entry.Entry) error

func (*Eagle) SyncStorage

func (e *Eagle) SyncStorage()

func (*Eagle) TransformEntry

func (e *Eagle) TransformEntry(id string, transformers ...EntryTransformer) (*entry.Entry, error)

func (*Eagle) UpdateBlogroll

func (e *Eagle) UpdateBlogroll() error

func (*Eagle) UpdateReadsSummary

func (e *Eagle) UpdateReadsSummary() error

func (*Eagle) UpdateSidecar

func (e *Eagle) UpdateSidecar(entry *entry.Entry, t func(*Sidecar) (*Sidecar, error)) error

func (*Eagle) UpdateWatchesSummary

func (e *Eagle) UpdateWatchesSummary() error

func (*Eagle) UploadAnonymousMedia

func (e *Eagle) UploadAnonymousMedia(ext string, reader io.Reader) (string, error)

func (*Eagle) UploadMedia

func (e *Eagle) UploadMedia(filename, ext string, reader io.Reader) (string, error)

type EntryTransformer

type EntryTransformer func(*entry.Entry) (*entry.Entry, error)

type Feed

type Feed struct {
	Title    string `json:"title"`
	Site     string `json:"site"`
	Feed     string `json:"feed"`
	Category string `json:"category"`
}

type ImgProxy

type ImgProxy struct {
	// contains filtered or unexported fields
}

func (*ImgProxy) Transform

func (i *ImgProxy) Transform(reader io.Reader, format string, width, quality int) (io.Reader, error)

type ImgProxySettings

type ImgProxySettings struct {
	Format  string
	Width   int
	Quality int
}

type IndividualStats

type IndividualStats struct {
	Name      string `json:"name"`
	Duration  int    `json:"duration"`
	Scrobbles int    `json:"scrobbles"`
}

type Lastfm

type Lastfm struct {
	*config.Lastfm
}

func (*Lastfm) Fetch

func (l *Lastfm) Fetch(year int, month time.Month, day int) ([]*lastfmTrack, error)

type Media

type Media struct {
	*config.BunnyCDN
	// contains filtered or unexported fields
}

func (*Media) UploadMedia

func (m *Media) UploadMedia(filename string, data io.Reader) (string, error)

type Miniflux

type Miniflux struct {
	*config.Miniflux
}

func (*Miniflux) Fetch

func (m *Miniflux) Fetch() ([]Feed, error)

type RenderData

type RenderData struct {
	// All pages must have some sort of Entry embedded.
	// This allows us to set generic information about
	// a page that may be needed.
	*entry.Entry

	Assets *Assets
	Me     config.Me
	Site   config.Site

	// For page-specific variables.
	Data interface{}

	Alternates   []Alternate
	User         string
	IsHome       bool
	IsLoggedIn   bool
	IsAdmin      bool
	NoIndex      bool
	TorUsed      bool
	OnionAddress string
	// contains filtered or unexported fields
}

func (*RenderData) GetEntry

func (rd *RenderData) GetEntry(id string) *entry.Entry

func (*RenderData) GetFile

func (rd *RenderData) GetFile(path string) string

func (*RenderData) GetJSON

func (rd *RenderData) GetJSON(path string) interface{}

func (*RenderData) GetSidecar

func (rd *RenderData) GetSidecar() *Sidecar

func (*RenderData) HasFile

func (rd *RenderData) HasFile(path string) bool

func (*RenderData) HeadTitle

func (rd *RenderData) HeadTitle() string

func (*RenderData) ReadsSummary

func (rd *RenderData) ReadsSummary() *entry.ReadsSummary

func (*RenderData) TryFiles

func (rd *RenderData) TryFiles(filenames ...string) string

func (*RenderData) WatchesSummary

func (rd *RenderData) WatchesSummary() *entry.WatchesSummary

type ScrobbleStats

type ScrobbleStats struct {
	Start               time.Time          `json:"start"`
	End                 time.Time          `json:"end"`
	TotalDuration       int                `json:"totalDuration"`
	ListeningClock      []int              `json:"listeningClock"`
	Scrobbles           int                `json:"scrobbles"`
	TracksPerDay        int                `json:"tracksPerDay"`
	DurationPerDay      int                `json:"durationPerDay"`
	ScrobblesPerWeekday []int              `json:"scrobblesPerWeekday"`
	UniqueArtists       int                `json:"uniqueArtists"`
	UniqueTracks        int                `json:"uniqueTracks"`
	UniqueAlbums        int                `json:"uniqueAlbums"`
	Artists             []*IndividualStats `json:"artists"`
	Tracks              []*IndividualStats `json:"tracks"`
	Albums              []*IndividualStats `json:"albums"`
}

type Sidecar

type Sidecar struct {
	Targets     []string                 `json:"targets"`
	Context     map[string]interface{}   `json:"context"`
	Webmentions []map[string]interface{} `json:"webmentions"`
}

type WebmentionPayload

type WebmentionPayload struct {
	Source  string                 `json:"source"`
	Secret  string                 `json:"secret"`
	Deleted bool                   `json:"deleted"`
	Target  string                 `json:"target"`
	Post    map[string]interface{} `json:"post"`
}

Jump to

Keyboard shortcuts

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