services

package
v0.0.0-...-8ac3aab Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Name       string
	Host       string
	Port       string
	Mode       string
	Timeout    int
	Conn       net.Conn
	ReExecTime int
	Status     struct {
		Code       int // 0是过程出错, 1是正常, 2是异常
		Message    string
		LastChange time.Time
		NeedExec   bool
	}
}

Server 服务器结构体

func NewServer

func NewServer() *Server

NewServer 创建新的server结构

func (*Server) ChangeStatus

func (svr *Server) ChangeStatus(code int, message string)

func (*Server) Check

func (svr *Server) Check(failFunc func(*Server, logs.Info) string, succeedFunc func(*Server, logs.Info) string, errorFunc func(*Server, logs.Info) string) (info logs.Info)

func (*Server) ParseFromConfig

func (svr *Server) ParseFromConfig(conf map[string]string)

ParseFromConfig 写入配置并赋初值

func (*Server) ReExec

func (svr *Server) ReExec(afunc func(*Server, logs.Info) string, info logs.Info)

func (*Server) TryConnect

func (svr *Server) TryConnect() (err error)

TryConnect 尝试连接此server

Jump to

Keyboard shortcuts

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