Documentation ¶
Overview ¶
* @Author: Malin Xie * @Description: * @Date: 2021-07-26 14:25:51
* @Author: Malin Xie * @Description: * @Date: 2021-07-26 14:40:41
* web entrance file. process all http reqeust and response action * @Author: Malin Xie * @Description: * @Date: 2021-07-26 12:34:45
* @Author: Malin Xie * @Description: * @Date: 2021-07-07 17:39:12
Index ¶
Constants ¶
View Source
const ( Default_PrefixPath = "/___" BlotFile = "server.data" Bucket_Name = "baidurpc_bucket" ErrorCode = -1 )
View Source
const (
Default_Timeout = 10 * time.Second
)
Variables ¶
View Source
var (
Use_Embed_Mode = true
)
Functions ¶
Types ¶
type RPCMethodList ¶
func (RPCMethodList) Len ¶
func (s RPCMethodList) Len() int
func (RPCMethodList) Less ¶
func (s RPCMethodList) Less(i, j int) bool
func (RPCMethodList) Swap ¶
func (s RPCMethodList) Swap(i, j int)
type ResponseData ¶
type ResponseData struct { ErrNo int `json:"errno"` Message string `json:"message,omitempty"` Data interface{} `json:"data,omitempty"` }
ResponseData standard web response struct to front end.
type RpcInfoList ¶
type RpcInfoList []RpcOptions
func (RpcInfoList) Len ¶
func (s RpcInfoList) Len() int
func (RpcInfoList) Less ¶
func (s RpcInfoList) Less(i, j int) bool
func (RpcInfoList) Swap ¶
func (s RpcInfoList) Swap(i, j int)
type RpcOptions ¶
type TemplateFS ¶
type TemplateFS struct { Content embed.FS Embbed bool Current string DelimsLeft string DelimsRigth string }
template FS mock
type WebModule ¶
type WebModule struct {
// contains filtered or unexported fields
}
WebModule web module entrance
func NewWebModule ¶
NewWebModule create a new web module.
func NewWebModuleWithListener ¶
func NewWebModuleWithListener(l net.Listener, prefixPath string, datadir string) (*WebModule, error)
NewWebModule create a new web module.
func (*WebModule) AddRPCServer ¶
AddRPCServer
Click to show internal directories.
Click to hide internal directories.