server

package
v0.0.0-...-58e3b6f Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAddr = "localhost"
	DefaultPort = 8080
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr string
	Port int
}

func NewServerConfig

func NewServerConfig() *Config

func (*Config) GetDSN

func (conf *Config) GetDSN() string

type HttpServer

type HttpServer struct {
	HTTP   *http.Server
	Router *gin.Engine
	Logger *alog.Alog
	Config *Config
}

func NewServer

func NewServer(conf *Config) *HttpServer

func (*HttpServer) Init

func (serv *HttpServer) Init(initRoutes func()) error

func (*HttpServer) SetMiddleware

func (serv *HttpServer) SetMiddleware(mw MiddlewareFunc) *HttpServer

func (*HttpServer) Up

func (serv *HttpServer) Up() error

type MiddlewareFunc

type MiddlewareFunc func() gin.HandlerFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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