pastes

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_EXPIRES_AT = 90

Functions

func CronDeleteExpiredPosts

func CronDeleteExpiredPosts(cfg *shared.ConfigSite, dbpool db.DB)

func GetBlogName

func GetBlogName(username string) string

func GetPostTitle

func GetPostTitle(post *db.Post) string

func NewConfigSite

func NewConfigSite() *shared.ConfigSite

func ParseText

func ParseText(filename string, text string) (string, error)

func StartApiServer

func StartApiServer()

func StartSshServer added in v1.2.0

func StartSshServer()

Types

type BlogPageData

type BlogPageData struct {
	Site      shared.SitePageData
	PageTitle string
	URL       template.URL
	RSSURL    template.URL
	Username  string
	Header    *HeaderTxt
	Posts     []PostItemData
}

type FileHooks

type FileHooks struct {
	Cfg *shared.ConfigSite
	Db  db.DB
}

func (*FileHooks) FileMeta

func (p *FileHooks) FileMeta(s ssh.Session, data *filehandlers.PostMetaData) error

func (*FileHooks) FileValidate

func (p *FileHooks) FileValidate(s ssh.Session, data *filehandlers.PostMetaData) (bool, error)

type HeaderTxt

type HeaderTxt struct {
	Title    string
	Bio      string
	Nav      []Link
	HasLinks bool
}
type Link struct {
	URL  string
	Text string
}

type PageData

type PageData struct {
	Site shared.SitePageData
}

type PostItemData

type PostItemData struct {
	URL            template.URL
	BlogURL        template.URL
	Username       string
	Title          string
	Description    string
	PublishAtISO   string
	PublishAt      string
	UpdatedAtISO   string
	UpdatedTimeAgo string
	Padding        string
}

type PostPageData

type PostPageData struct {
	Site         shared.SitePageData
	PageTitle    string
	URL          template.URL
	RawURL       template.URL
	BlogURL      template.URL
	Title        string
	Description  string
	Username     string
	BlogName     string
	Contents     template.HTML
	PublishAtISO string
	PublishAt    string
	ExpiresAt    string
}

type SSHServer added in v1.2.0

type SSHServer struct{}

type TransparencyPageData

type TransparencyPageData struct {
	Site      shared.SitePageData
	Analytics *db.Analytics
}

Jump to

Keyboard shortcuts

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