Documentation
¶
Index ¶
- Constants
- func Addr() *net.TCPAddr
- func EnableTLS() bool
- func GenerateAddr(scheme, host string, port int) string
- func InitServerInfo(addr string, tls bool)
- func NewSessionStore(sessionMode int, sessionConnection string) (sessions.Store, error)
- func Port() int
- func PrintAnonymousAccessWarning()
- type ApiResult
- type Option
Constants ¶
View Source
const ( // ParamUserName the parameter name of username ParamUserName = "username" // ParamPassword the parameter name of password ParamPassword = "password" // ParamReturnUrl the parameter name of return url ParamReturnUrl = "return_url" // ParamFormat the format of config file, support json and yaml currently ParamFormat = "format" )
View Source
const ( // RootGroupRoute the group route of root RootGroupRoute = "/" // DefaultRoute the route of default DefaultRoute = "/" // SourceRoutePrefix the route prefix of source SourceRoutePrefix = "/source/" // DestRoutePrefix the route prefix of dest DestRoutePrefix = "/dest/" // QueryRoute the route of query api QueryRoute = "/query" // LoginGroupRoute the group route of login LoginGroupRoute = "/login" // LoginIndexRoute the route of login index page LoginIndexRoute = "/index" // LoginIndexFullRoute the full route of login index page LoginIndexFullRoute = LoginGroupRoute + LoginIndexRoute // LoginSignInRoute the route of sign in api LoginSignInRoute = "/signin" // LoginSignInFullRoute the full route of sign in api LoginSignInFullRoute = LoginGroupRoute + LoginSignInRoute // WriteGroupRoute the group route of write api WriteGroupRoute = "/w" // PushRoute the route of push api PushRoute = "/push" // PushFullRoute the full route of push api PushFullRoute = WriteGroupRoute + PushRoute // ManageGroupRoute the group route of manage api ManageGroupRoute = "/manage" // ManageConfigRoute the route of manage config api ManageConfigRoute = "/config" // ManageReportRoute the route of report api ManageReportRoute = "/report" // PProfRoutePrefix the route prefix of pprof PProfRoutePrefix = "pprof" )
View Source
const ( // DefaultAddrHttps the default https address DefaultAddrHttps = ":443" // DefaultAddrHttp the default http address DefaultAddrHttp = ":80" // SchemeHttp the http scheme name SchemeHttp = "http" // SchemeHttps the https scheme name SchemeHttps = "https" // DefaultPortHttp the default port of http server DefaultPortHttp = 80 // DefaultPortHttps the default port of https server DefaultPortHttps = 443 )
View Source
const ( // SessionName the name of the session SessionName = "session_id" // SessionUser the key of the session user SessionUser = "user" )
View Source
const ( // MemorySession represent a memory session store MemorySession = iota + 1 // RedisSession represent a redis session store RedisSession )
View Source
const (
// ResourceTemplatePath the web server template resource path
ResourceTemplatePath = "server/template/*"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateAddr ¶
GenerateAddr generate http or https address
func InitServerInfo ¶
InitServerInfo int the file web server
func NewSessionStore ¶ added in v0.4.2
NewSessionStore create a session store, stored in memory or redis, default is memory
func PrintAnonymousAccessWarning ¶
func PrintAnonymousAccessWarning()
PrintAnonymousAccessWarning print the warning log of anonymous access
Types ¶
type ApiResult ¶
type ApiResult struct { Code contract.Code `json:"code"` Message string `json:"message"` Data any `json:"data"` }
ApiResult the common result of api response
func NewApiResult ¶
NewApiResult create an instance of the ApiResult
func NewErrorApiResult ¶
NewErrorApiResult create an instance of the ApiResult that contains error info
func NewServerErrorResult ¶ added in v0.3.0
func NewServerErrorResult() ApiResult
NewServerErrorResult create an instance of the ApiResult that means server error
type Option ¶
type Option struct { Source core.VFS Dest core.VFS Addr string EnableTLS bool TLSCertFile string TLSKeyFile string EnableFileServerCompress bool EnableManage bool ManagePrivate bool EnableLogicallyDelete bool EnablePushServer bool EnableReport bool SessionMode int SessionConnection string ChunkSize int64 CheckpointCount int Init wait.WaitDone Users []*auth.User Logger log.Logger Retry retry.Retry }
Option the web server option
Click to show internal directories.
Click to hide internal directories.