imgs

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlogName

func GetBlogName(username string) string

func GetPostTitle

func GetPostTitle(post *db.Post) string

func NewConfigSite

func NewConfigSite() *shared.ConfigSite

func StartApiServer

func StartApiServer()

Types

type BlogPageData

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

type HeaderTxt

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

type IImgsAPI

type IImgsAPI interface {
	HasAccess(userID string) bool
	Upload(file *utils.FileEntry) (string, error)
}

type ImgHandler

type ImgHandler struct {
	Username  string
	Subdomain string
	Slug      string
	Cfg       *shared.ConfigSite
	Dbpool    db.DB
	Storage   storage.ObjectStorage
	Logger    *zap.SugaredLogger
	Cache     *gocache.Cache
	Ratio     *storage.Ratio
	Original  bool
}

type ImgsLinkify

type ImgsLinkify struct {
	Cfg          *shared.ConfigSite
	Username     string
	OnSubdomain  bool
	WithUsername bool
}

func NewImgsLinkify

func NewImgsLinkify(username string) *ImgsLinkify

func (*ImgsLinkify) Create

func (i *ImgsLinkify) Create(fname string) string
type Link struct {
	URL  template.URL
	Text string
}

type PageData

type PageData struct {
	Site shared.SitePageData
}

type PostItemData

type PostItemData struct {
	BlogURL      template.URL
	URL          template.URL
	ImgURL       template.URL
	PublishAtISO string
	PublishAt    string
	Caption      string
}

type PostPageData

type PostPageData struct {
	Site         shared.SitePageData
	PageTitle    string
	URL          template.URL
	BlogURL      template.URL
	Slug         string
	Title        string
	Caption      string
	Contents     template.HTML
	Text         string
	Username     string
	BlogName     string
	PublishAtISO string
	PublishAt    string
	Tags         []Link
	ImgURL       template.URL
	PrevPage     template.URL
	NextPage     template.URL
}

type ReadmeTxt

type ReadmeTxt struct {
	HasText  bool
	Contents template.HTML
}

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