server

package
v0.0.0-...-e38a99a Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamUserName  = "username"
	ParamPassword  = "password"
	ParamReturnUrl = "return_url"
)
View Source
const (
	SourceRoutePrefix    = "/source/"
	DestRoutePrefix      = "/dest/"
	QueryRoute           = "/query"
	LoginRoute           = "/login"
	LoginIndexRoute      = "/index"
	LoginIndexFullRoute  = LoginRoute + LoginIndexRoute
	LoginSignInRoute     = "/signin"
	LoginSignInFullRoute = LoginRoute + LoginSignInRoute
	WriteGroupRoute      = "/w"
	PushRoute            = "/push"
	PushFullRoute        = WriteGroupRoute + PushRoute
)
View Source
const (
	DefaultAddrHttps = ":443"
	DefaultAddrHttp  = ":80"
	SchemeHttp       = "http"
	SchemeHttps      = "https"
	DefaultPortHttp  = 80
	DefaultPortHttps = 443
)
View Source
const (
	SessionName = "session_id"
	SessionUser = "user"
)
View Source
const (
	ResourceTemplatePath = "server/template/*"
)

Variables

This section is empty.

Functions

func Addr

func Addr() *net.TCPAddr

Addr the addr of file server running

func DefaultSessionStore

func DefaultSessionStore() (sessions.Store, error)

func EnableTLS

func EnableTLS() bool

EnableTLS is using https on the file server

func GenerateAddr

func GenerateAddr(scheme, host string, port int) string

GenerateAddr generate http or https address

func InitServerInfo

func InitServerInfo(addr string, tls bool)

func Port

func Port() int

Port the port of file server running

func PrintAnonymousAccessWarning

func PrintAnonymousAccessWarning()

Types

type ApiResult

type ApiResult struct {
	Code    contract.Code `json:"code"`
	Message string        `json:"message"`
	Data    interface{}   `json:"data"`
}

func NewApiResult

func NewApiResult(code contract.Code, message string, data interface{}) ApiResult

func NewErrorApiResult

func NewErrorApiResult(code contract.Code, message string) ApiResult

func NewServerErrorResult

func NewServerErrorResult() ApiResult

type Option

type Option struct {
	Source                core.VFS
	Dest                  core.VFS
	Addr                  string
	Init                  wait.WaitDone
	EnableTLS             bool
	CertFile              string
	KeyFile               string
	Users                 []*auth.User
	EnableCompress        bool
	Logger                log.Logger
	EnablePprof           bool
	PprofPrivate          bool
	EnableLogicallyDelete bool
	EnablePushServer      bool
}

func NewServerOption

func NewServerOption(config conf.Config, init wait.WaitDone, users []*auth.User, logger log.Logger) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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