server

package
v0.0.0-...-a273e7d Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IServer

type IServer interface {
	Launch(Setting)
	LaunchRestfult([]restfult.Setting)
	LaunchSocket([]socket.Setting)
	LaunchDB()
	Log(string)
	ErrorLog(string)
}

IServer ...

type Service

type Service struct {
	ShotDown chan bool
	Setting  Setting
	Restfult *restfult.Service
	Socket   *socket.Service
	HTTPConn *myhttp.Service
	Transfer *transaction.Service

	IGame igame.IGame
	DBs   map[string]*dbservice.DB
}

Service IServr

func NewService

func NewService() *Service

NewService ...

func (*Service) DBConn

func (s *Service) DBConn(nameDB string) *sql.DB

DBConn ...

func (*Service) ErrorLog

func (s *Service) ErrorLog(log string)

ErrorLog ...

func (*Service) HTTPResponse

func (s *Service) HTTPResponse(httpconn http.ResponseWriter, data interface{}, err messagehandle.ErrorMsg)

HTTPResponse Respond to cliente

func (*Service) Launch

func (s *Service) Launch(setting Setting)

Launch server start

func (*Service) LaunchDB

func (s *Service) LaunchDB(nameDB string, setting dbservice.ConnSetting) error

LaunchDB ...

func (*Service) LaunchRestfult

func (s *Service) LaunchRestfult(setting []restfult.Setting)

LaunchRestfult service start

func (*Service) LaunchSocket

func (s *Service) LaunchSocket(setting []socket.Setting)

LaunchSocket service start

func (*Service) Log

func (s *Service) Log(log string)

Log ...

type Setting

type Setting struct {
	AccountEncodeStr   string
	DBIP               string
	DBPassword         string
	DBPORT             string
	DBUser             string
	IP                 string
	PORT               string
	SocketPort         string
	MaintainFinishTime string
	MaintainStartTime  string
	RedisURL           string
	TransferURL        string
	ServerMod          string
	// contains filtered or unexported fields
}

Setting ...

func NewSetting

func NewSetting() Setting

NewSetting ..

func (Setting) DBSetting

func (s Setting) DBSetting() dbservice.ConnSetting

DBSetting ...

func (*Setting) MaintainTime

func (s *Setting) MaintainTime() int64

MaintainTime ...

func (Setting) RestfultAdderss

func (s Setting) RestfultAdderss() string

RestfultAdderss ...

func (*Setting) ServerTime

func (s *Setting) ServerTime() int64

ServerTime ...

func (*Setting) SetData

func (s *Setting) SetData(data map[string]interface{})

SetData ...

func (Setting) SocketAdderss

func (s Setting) SocketAdderss() string

SocketAdderss ...

func (*Setting) ToClient

func (s *Setting) ToClient() map[string]interface{}

ToClient ...

Jump to

Keyboard shortcuts

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