server

package
v0.0.0-...-52c1056 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 63 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPlugin

func RegisterPlugin(name string, pluginInitializer PluginInitializer)

Types

type ActionPlugin

type ActionPlugin interface {
	ActionName() string
	Action() error
}

type CronPlugin

type CronPlugin interface {
	DailyCron() error
}

type HandlerPlugin

type HandlerPlugin interface {
	HandlerRoute() string
	Handler(http.ResponseWriter, *http.Request, *PluginWebUtilities)
}

type HookPlugin

type HookPlugin interface {
	PreSaveHook(*core.Entry) error
	PostSaveHook(*core.Entry) error
}

type Photo

type Photo struct {
	Data     []byte
	Title    string
	MimeType string
	Width    int
	Height   int
}

type Plugin

type Plugin = any

type PluginInitializer

type PluginInitializer func(co *core.Core, config map[string]any) (Plugin, error)

type PluginWebUtilities

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

func (*PluginWebUtilities) ErrorHTML

func (u *PluginWebUtilities) ErrorHTML(w http.ResponseWriter, r *http.Request, code int, reqErr error)

func (*PluginWebUtilities) ErrorJSON

func (u *PluginWebUtilities) ErrorJSON(w http.ResponseWriter, code int, err, errDescription string)

func (*PluginWebUtilities) JSON

func (u *PluginWebUtilities) JSON(w http.ResponseWriter, code int, data any)

type Server

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

func NewServer

func NewServer(c *core.Config) (*Server, error)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type SyndicationContext

type SyndicationContext struct {
	Thumbnail *Photo
	Status    string
	Photos    []*Photo
}

type SyndicationPlugin

type SyndicationPlugin interface {
	Syndicator() Syndicator
	IsSyndicated(*core.Entry) bool
	Syndicate(context.Context, *core.Entry, *SyndicationContext) error
}

type Syndicator

type Syndicator struct {
	UID     string
	Name    string
	Default bool
}

Jump to

Keyboard shortcuts

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