server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleTmplContext

type ArticleTmplContext struct {
	Title      string
	Date       time.Time
	HTML       template.HTML
	IsMarkDown bool
	LiveReload bool
}

func (*ArticleTmplContext) MarkDown

func (a *ArticleTmplContext) MarkDown(content []byte) error

func (*ArticleTmplContext) Write

type DirTmplContext

type DirTmplContext struct {
	RootDirPath string
	RootDirName string
	// Pwdf means print working directory or file.
	Pwdf       []Path
	Entries    []File
	LiveReload bool
}

func (*DirTmplContext) Write

func (d *DirTmplContext) Write(w http.ResponseWriter)

type File

type File struct {
	Name      string
	URL       string
	UpdatedAt time.Time
}

type Message

type Message struct {
	Command string `json:"command"`
	Data    string `json:"data"`
}

type Path

type Path struct {
	Base string
	URL  string
}

type Server

type Server struct {
	Port        int
	Watch       bool
	Bind        string
	RootDirName string
	RootDirPath string
}

func (*Server) Run

func (s *Server) Run() error

Jump to

Keyboard shortcuts

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