server

package
v0.0.0-...-99fd40c Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsValidHexColor = regexp.MustCompile("^[a-f0-9]{6}$").MatchString

Functions

func GetRequestIP

func GetRequestIP(r *http.Request) net.IP

func VerifyHost

func VerifyHost(u *url.URL) (bool, error)

Types

type Server

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

func New

func New(backend storage.Backend, identity identity.Identity) *Server

func (Server) Delete

func (s Server) Delete(w http.ResponseWriter, r *http.Request)

func (Server) Feed

func (s Server) Feed(w http.ResponseWriter, r *http.Request)

func (Server) Post

func (s Server) Post(w http.ResponseWriter, r *http.Request)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (Server) View

func (s Server) View(w http.ResponseWriter, r *http.Request)

type Theme

type Theme struct {
	Style   string
	Even    string
	Odd     string
	Border  string
	Text    string
	Message string
	Link    string
}

func ThemeFromURLValues

func ThemeFromURLValues(v url.Values) Theme

type ViewData

type ViewData struct {
	Referer   *url.URL
	Theme     Theme
	Requester identity.ID
	Posts     []storage.Post
}

Jump to

Keyboard shortcuts

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