server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server serves a HTML rendered Markdown preview. It can serve a single file or a directory (with file selection via ?file= query parameter).

func New

func New(ctx context.Context, path string, log *logrus.Logger) (*Server, error)

New creates a new Server. path can be a file or directory.

func (*Server) Run

func (s *Server) Run() (http.Handler, error)

Run returns handlers to run the server.

type TreeEntry

type TreeEntry struct {
	Name     string      `json:"name"`
	Path     string      `json:"path"`
	IsDir    bool        `json:"isDir"`
	Status   string      `json:"status,omitempty"` // M=modified, A=added, ?=untracked, D=deleted
	Children []TreeEntry `json:"children,omitempty"`
}

TreeEntry represents a file or directory in the tree.

Jump to

Keyboard shortcuts

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