server

package
v0.0.0-...-1e66a83 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DomainMap = make(map[string]string)

Functions

func DiskUsage

func DiskUsage(path string) (diskFree int64)

Types

type CommandExec

type CommandExec struct {
	CommandLine string `json:"command"`
}

func (*CommandExec) ExecuteCommand

func (C *CommandExec) ExecuteCommand() (err error)

type Forward

type Forward struct {
	Url    string      `json:"url"`
	Body   string      `json:"body"`
	Method string      `json:"method"`
	Header http.Header `json:"header"`
}

type MountPathInfo

type MountPathInfo struct {
	Path    string `json:"path"`
	Require string `json:"require"`
}

type MysqlInfo

type MysqlInfo struct {
	MysqlHost string `json:"mysql_host"`
	MysqlPort string `json:"mysql_port"`
	MysqlName string `json:"mysql_name"`
	MysqlPwd  string `json:"mysql_pwd"`
}

func (*MysqlInfo) ConnetMySql

func (M *MysqlInfo) ConnetMySql() (db *sql.DB, err error)

type PortRequest

type PortRequest struct {
	Ports []int `json:"ports"`
}

func (*PortRequest) StartServers

func (p *PortRequest) StartServers() error

type Request

type Request struct {
	Domain string `json:"domain"`
	Value  string `json:"value"`
}

type Requst

type Requst struct {
	Scop         string    `json:"scop"`
	Mysql        MysqlInfo `json:"mysql_info"`
	DatabaseName string    `json:"database_name"`
	SQL          string    `json:"sql"`
}

func (*Requst) Executed

func (R *Requst) Executed(db *sql.DB) (err error)

type Server

type Server struct {
	Addr      string
	ServerMux *http.ServeMux
	Server    *http.Server
}

func NewServer

func NewServer(port int) *Server

func (*Server) AddHealthHandler

func (s *Server) AddHealthHandler()

func (*Server) CheckHealth

func (s *Server) CheckHealth(ctx context.Context, c *pb.Check) (*pb.Result, error)

func (*Server) ExecuteCommand

func (s *Server) ExecuteCommand(stream pb.RouteCall_ExecuteCommandServer) error

func (*Server) ExecuteRequest

func (s *Server) ExecuteRequest(stream pb.RouteCall_ExecuteRequestServer) error

func (*Server) ExecuteSql

func (s *Server) ExecuteSql(stream pb.RouteCall_ExecuteSqlServer) error

func (*Server) HandlerInit

func (s *Server) HandlerInit()

func (*Server) InitGRpcServer

func (s *Server) InitGRpcServer(port int)

func (*Server) Start

func (s *Server) Start() error

type ServerAddr

type ServerAddr struct {
	Hosts []string `json:"hosts"`
	Ports []int    `json:"ports"`
}

func (*ServerAddr) StartNetCheck

func (s *ServerAddr) StartNetCheck() (err error)

type StorageStatus

type StorageStatus struct {
	Success bool   `json:"success"`
	Free    string `json:"free"`
}

Jump to

Keyboard shortcuts

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