server

package
v0.0.0-...-9a36425 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 57 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deflatten

func Deflatten(data map[string]any) map[string]any

Deflatten takes a flattened map and deflattens all single values to arrays.

func Flatten

func Flatten(data map[string][]any) map[string]any

Flatten takes a Microformats map and flattens all arrays with a single value to one element.

func RegisterPlugin

func RegisterPlugin(name string, pluginInitializer PluginInitializer)

func Update

func Update(properties map[string][]any, req micropub.RequestUpdate) (map[string][]any, error)

Update updates a set of existing properties with the new request.

Types

type Plugin

type Plugin interface {
	GetWebHandler(utils *PluginWebUtilities) (string, http.HandlerFunc)
	GetAction() (string, func() error)
	GetDailyCron() func() error
}

type PluginInitializer

type PluginInitializer func(co *core.Core, config map[string]interface{}) (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 interface{})

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

Jump to

Keyboard shortcuts

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