server

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directory added in v0.0.5

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

func (*Directory) Chdir added in v0.6.0

func (d *Directory) Chdir(path string) (cms.Directory, error)

func (*Directory) Info added in v0.9.0

func (d *Directory) Info() (fs.FileInfo, error)

func (*Directory) IsDir added in v0.9.0

func (d *Directory) IsDir() bool

func (*Directory) MkdirAll added in v0.0.6

func (d *Directory) MkdirAll(path string) (cms.Directory, error)

func (*Directory) ModTime added in v0.9.0

func (d *Directory) ModTime() time.Time

func (*Directory) Mode added in v0.9.0

func (d *Directory) Mode() fs.FileMode

func (*Directory) Name added in v0.9.0

func (d *Directory) Name() string

func (*Directory) Open added in v0.6.0

func (d *Directory) Open(path string) (cms.Resource, error)

func (*Directory) Path added in v0.0.5

func (d *Directory) Path() string

func (*Directory) Size added in v0.9.0

func (d *Directory) Size() int64

func (*Directory) Sys added in v0.9.0

func (d *Directory) Sys() interface{}

func (*Directory) Type added in v0.9.0

func (d *Directory) Type() fs.FileMode

type Sandbox added in v0.0.3

type Sandbox struct {
	cms.Directory
	// contains filtered or unexported fields
}

A Sandbox is a chroot-ed Directory

func (*Sandbox) Chdir added in v0.6.0

func (s *Sandbox) Chdir(path string) (cms.Directory, error)

func (*Sandbox) Chroot added in v0.0.3

func (s *Sandbox) Chroot(path string) (cms.Directory, error)

Spawn Sandbox from Sandbox

func (*Sandbox) MkdirAll added in v0.0.5

func (s *Sandbox) MkdirAll(path string) (cms.Directory, error)

func (*Sandbox) Open added in v0.6.0

func (s *Sandbox) Open(path string) (cms.Resource, error)

func (*Sandbox) View added in v0.0.3

func (s *Sandbox) View(path string) cms.View

Spawn cms.View from Sandbox

type Server

type Server struct {
	cms.ViewConfig

	Root  string
	Cache string
	// contains filtered or unexported fields
}

CMS Server

func NewServer

func NewServer(root, cache string, options ...ServerOption) (*Server, error)

func (*Server) Chdir added in v0.6.0

func (s *Server) Chdir(path string) (cms.Directory, error)

func (*Server) Chroot added in v0.0.3

func (s *Server) Chroot(path string) (cms.Directory, error)

Spawn Sandbox from Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Connect

func (s *Server) Connect(ctx context.Context) error

func (*Server) Info added in v0.9.0

func (s *Server) Info() (fs.FileInfo, error)

func (*Server) IsDir added in v0.9.0

func (s *Server) IsDir() bool

func (*Server) MkdirAll added in v0.0.5

func (s *Server) MkdirAll(path string) (cms.Directory, error)

func (*Server) ModTime added in v0.9.0

func (s *Server) ModTime() time.Time

func (*Server) Mode added in v0.9.0

func (s *Server) Mode() fs.FileMode

func (*Server) Name added in v0.9.0

func (s *Server) Name() string

func (*Server) Open added in v0.6.0

func (s *Server) Open(path string) (cms.Resource, error)

func (*Server) Path added in v0.0.6

func (s *Server) Path() string

func (*Server) Size added in v0.9.0

func (s *Server) Size() int64

func (*Server) Sys added in v0.9.0

func (s *Server) Sys() interface{}

func (*Server) Type added in v0.9.0

func (s *Server) Type() fs.FileMode

func (*Server) View

func (s *Server) View(path string) cms.View

Spawn cms.View from Server

type ServerOption

type ServerOption interface {
	ApplyOption(*Server) error
}

Server Options

func SetEditHandler added in v0.0.3

func SetEditHandler(path string, handler web.HandlerFunc) ServerOption

Set Server's default File editor

func SetErrorHandler added in v0.0.3

func SetErrorHandler(handler web.ErrorHandlerFunc) ServerOption

Set Server's default error Handler

func SetFilesHandler added in v0.0.3

func SetFilesHandler(path string, handler web.HandlerFunc) ServerOption

Set Server's default File manager

func SetGetDirectory added in v0.7.0

func SetGetDirectory(getDirectory func(context.Context) cms.Directory) ServerOption

Set ViewConfig.GetDirectory

func SetGetResource added in v0.0.3

func SetGetResource(getResource func(context.Context) cms.Resource) ServerOption

Set ViewConfig.GetResource

func SetGetRoutePath added in v0.0.3

func SetGetRoutePath(getRoutePath func(r *http.Request) string) ServerOption

Set ViewConfig.GetRoutePath

func SetGetUser added in v0.0.3

func SetGetUser(getUser func(context.Context) cms.User) ServerOption

Set ViewConfig.GetUser

func SetIndexPage added in v0.0.3

func SetIndexPage(index string) ServerOption

Set Server's default resource for a given directory

func SetPingHandler added in v0.0.3

func SetPingHandler(path string, handler web.HandlerFunc) ServerOption

Set Server's default Heartbeat handler

func SetSetDirectory added in v0.7.0

func SetSetDirectory(setDirectory func(context.Context, cms.Directory) context.Context) ServerOption

Set ViewConfig.SetDirectory

func SetSetResource added in v0.0.3

func SetSetResource(setResource func(context.Context, cms.Resource) context.Context) ServerOption

Set ViewConfig.SetResource

func SetSitemapHandler added in v0.0.3

func SetSitemapHandler(path string, handler web.HandlerFunc) ServerOption

Set Server's default Sitemap handler

type ServerOptionFunc added in v0.0.3

type ServerOptionFunc func(*Server) error

func (ServerOptionFunc) ApplyOption added in v0.5.0

func (f ServerOptionFunc) ApplyOption(s *Server) error

Jump to

Keyboard shortcuts

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