server

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProviderProductionSet provides a new Server for use in production.
	ProviderProductionSet = wire.NewSet(Provide, Cfg)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Address string
}

Config contains the parameters for configuring a Server.

func Cfg

func Cfg(v *viper.Viper) (*Config, error)

Cfg provides a new Config using values from a Viper.

func CfgTest

func CfgTest(cfg Config) (*Config, error)

CfgTest provides the passed Config.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server contains the Config and Router for serving requests.

func Build

func Build(db *database.Manager, v *viper.Viper, log2 *log.Log) (*Server, error)

func New

func New(cfg Config, router *router.Router) *Server

New returns a new Server configured with the given Config and Router.

func Provide

func Provide(cfg *Config, router *router.Router) *Server

Provide provides a new Server containing the given Config and Router.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe begins serving requests.

Jump to

Keyboard shortcuts

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