server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIST_DIR_WWW    = "dist"
	DIST_DIR_SERVER = "dist_server"
)

Variables

This section is empty.

Functions

func GetStaticAndProxyHandler

func GetStaticAndProxyHandler(urlPrefix, rootPath string) gin.HandlerFunc

func HandleSsrRequest

func HandleSsrRequest(c *gin.Context)

func NewServer

func NewServer(c *Config) error

Types

type Config

type Config struct {
	Host            string        `toml:"host"`
	Log             tlog.Config   `toml:"Log"`
	Env             string        `toml:"env"`
	V8MaxCount      int32         `toml:"v8_maxcount"`
	V8LifeTime      int           `toml:"v8_lifetime"`
	ClientPath      string        `toml:"client_path"`
	StaticUrlPath   string        `toml:"static_url_path"`
	InternalApiHost string        `toml:"internal_api_host"`
	InternalApiIp   string        `toml:"internal_api_ip"`
	InternalApiPort int32         `toml:"internal_api_port"`
	IsApiDelegate   bool          `toml:"is_api_delegate"`
	TemplateName    string        `toml:"template_name"`
	ClientCookie    string        `toml:"client_cookie"`
	RedirectOnerror string        `toml:"redirect_onerror"`
	SsrCtx          []string      `toml:"ssr_ctx"`
	TemplateVars    []TemplateVar `toml:"template_vars"`
	AlarmUrl        string        `toml:"alarm_url"`
	AlarmSecret     string        `toml:"alarm_secret"`
}

type DebugTransport

type DebugTransport struct{}

func (DebugTransport) RoundTrip

func (DebugTransport) RoundTrip(r *http.Request) (*http.Response, error)

type Request

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

type RequestMgr

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

func NewRequestMgr

func NewRequestMgr() *RequestMgr

func (*RequestMgr) DestroyRequest

func (this *RequestMgr) DestroyRequest(reqId int64)

func (*RequestMgr) GetRequest

func (this *RequestMgr) GetRequest(reqId int64) *Request

func (*RequestMgr) NewRequest

func (this *RequestMgr) NewRequest() *Request

type Server

type Server struct {
	RequstMgr       *RequestMgr
	V8Mgr           *v8.V8Mgr
	HostPort        int
	ClientPath      string
	Env             string
	IsApiDelegate   bool
	ClientCookie    string
	RedirectOnerror string
	SsrTemplate     string
	SsrCtx          []string
	TemplateVars    map[string]string
	TemplateUrlEnv  string
}
var ThisServer *Server

type SsrResult

type SsrResult struct {
	Html string            `json:"html"`
	Css  string            `json:"css"`
	Meta map[string]string `json:"meta"`
}

type TemplateVar

type TemplateVar struct {
	Key  string `toml:"key"`
	Type string `toml:"type"`
}

Jump to

Keyboard shortcuts

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