server

package
v0.0.0-...-86a594b Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDataSource

func CloseDataSource(datasource *data.DataSource)

func LoadDataSource

func LoadDataSource(ctx context.Context, dataConf *conf.DataConf) (*data.DataSource, error)

func LogBanner

func LogBanner(buildInfo conf.BuildInfo, logConf *conf.LogConf, logger *logrus.Logger, bannerPath string) error

func NewDockerClient

func NewDockerClient(ctx context.Context) (*client.Client, error)

NewDockerClient returns a DockerClient from local environment

func NewGRPCServer

func NewGRPCServer(grpcConf *conf.GrpcConf, logger kratoslog.Logger) *grpc.Server

NewGRPCServer initializes a new grpc server with kratos framework

func NewHttpServer

func NewHttpServer(cfg *conf.WilsonConf, lang *locale.Locale, logger *logrus.Logger) (*gin.Engine, *http.Server)

NewHttpServer initializes http server configuration

func NewLocale

func NewLocale(cfg *locale.Conf) (*locale.Locale, error)

func NewLogger

func NewLogger(logConf *conf.LogConf) (*log.Logger, error)

NewLogger config logrus middleware

func NewSteamClient

func NewSteamClient(cfg *conf.DstConf) (*steamapi.Client, error)

Types

type HttpServer

type HttpServer struct {
	Logger *log.Logger
	Locale *locale.Locale
	// contains filtered or unexported fields
}

func NewHTTPApp

func NewHTTPApp(options ...Options) (*HttpServer, error)

func (*HttpServer) Run

func (a *HttpServer) Run() error

func (*HttpServer) Shutdown

func (a *HttpServer) Shutdown()

type Options

type Options func(app *HttpServer)

func WithConf

func WithConf(appConf *conf.WilsonConf) Options

func WithCtx

func WithCtx(ctx context.Context) Options

func WithLogger

func WithLogger(logger *log.Logger) Options

func (Options) Apply

func (o Options) Apply(app *HttpServer)

Jump to

Keyboard shortcuts

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