server

package
v0.0.0-...-8724ffd Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Config          *pkg.Config
	Store           db.Store
	Router          *gin.Engine
	TokenMaker      token.Maker
	TaskDistributor worker.TaskDistributor
	HttpServer      *http.Server
}

Server serves HTTP requests for our banking service.

func NewServer

func NewServer(
	store db.Store,
	config *pkg.Config,
	tokenMaker token.Maker,
	taskDistributor worker.TaskDistributor,
) (*Server, error)

NewServer creates a new HTTP server and set up routing.

func NewTestServer

func NewTestServer(t *testing.T, store db.Store, cf *pkg.Config, taskDistributor worker.TaskDistributor) *Server

NewTestServer creates a new HTTP server for testing.

func (*Server) Start

func (server *Server) Start() error

func (*Server) Stop

func (server *Server) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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