modules

package
v0.0.0-...-2379ac9 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("server",

	fx.Provide(
		New,
	),
	fx.Provide(
		fx.Private,

		parseConfig,
	),

	fx.Invoke(startServer),

	fx.Decorate(wrapLogger),
)

Module is an example of an Fx module's skeleton. region start region provide region invoke region decorate region private

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr string `yaml:"addr"`
}

Config is the configuration of the server. region config

type Params

type Params struct {
	fx.In

	Log    *zap.Logger
	Config Config
}

Params defines the parameters of the module. region params

type Result

type Result struct {
	fx.Out

	Server *Server
}

Result defines the results of the module. region result

func New

func New(p Params) (Result, error)

New builds a new server. region new

type Server

type Server struct{}

Server is the server.

func (*Server) Start

func (*Server) Start() error

Start starts the server.

Jump to

Keyboard shortcuts

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