gmain

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSysConf = Config{
		HttpServer: Host{
			Enabled:        true,
			Host:           "0.0.0.0:8888",
			ReadTimeOut:    300,
			WriteTimeOut:   3000,
			MaxConcurrency: 10240,
		},
		GrpcServer: Host{
			Enabled:        true,
			Host:           "0.0.0.0:50051",
			ReadTimeOut:    300,
			WriteTimeOut:   3000,
			MaxConcurrency: 10240,
		},
		Modules:   []Module{},
		Locations: []Location{},
		SysLog:    FilePath{Path: "./configs/log.toml"},
		FuncLog:   FilePath{Path: "./configs/funclog.toml"},
		Pprof:     pprof{Enabled: true, Port: 8886},
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	HttpServer Host `xml:"http" json:"http" yaml:"http" toml:"http"`
	GrpcServer Host `xml:"grpc" json:"grpc" yaml:"grpc" toml:"grpc"`

	Modules   []Module   `xml:"modules" json:"modules" yaml:"modules" toml:"modules"`
	Locations []Location `xml:"locations" json:"locations" yaml:"locations" toml:"locations"`

	SysLog  FilePath `xml:"logsys" json:"logsys" yaml:"logsys" toml:"logsys"`
	FuncLog FilePath `xml:"logfunc" json:"logfunc" yaml:"logfunc" toml:"logfunc"`
	Pprof   pprof    `xml:"pprof" json:"pprof" yaml:"pprof" toml:"pprof"`
}

type FilePath

type FilePath struct {
	Path string `xml:"path" json:"path" yaml:"path" toml:"path"`
}

type Host

type Host struct {
	Enabled        bool   `xml:"enabled,attr" json:"enabled" yaml:"enabled" toml:"enabled"`
	Host           string `xml:"host" json:"host" yaml:"host" toml:"host"`
	ReadTimeOut    int    `xml:"readtimeout" json:"readtimeout" yaml:"readtimeout" toml:"readtimeout"`
	WriteTimeOut   int    `xml:"writetimeout" json:"writetimeout" yaml:"writetimeout" toml:"writetimeout"`
	MaxConcurrency int    `xml:"maxconcurrency" json:"maxconcurrency" yaml:"maxconcurrency" toml:"maxconcurrency"`
}

type Location

type Location struct {
	Location string `xml:"location" json:"location" yaml:"location" toml:"location"`
	Module   string `xml:"module" json:"module" yaml:"module" toml:"module"`
}

type Module

type Module struct {
	Name string `xml:"name" json:"name" yaml:"name" toml:"name"`
	Conf string `xml:"conf" json:"conf" yaml:"conf" toml:"conf"`
}

type Server

type Server struct {
	Conf *Config

	HttpServer *gin.Engine
	GrpcServer *grpc.Server
}

func NewServer

func NewServer(aFile string) *Server

func (*Server) Startup

func (s *Server) Startup()

Jump to

Keyboard shortcuts

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