server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHandler

func BuildHandler(logger log.Logger, db *dbcontext.DB, sec password.Service,
	cfg *config.Config, version string, trans ut.Translator,
	updown storage.UploadDownloader, p queue.Producer,
	smtpClient mailer.SMTPClient, arch archive.Archiver,
	tokenGen token.Service,
	emailTpl tpl.Service) http.Handler

BuildHandler sets up the HTTP routing and builds an HTTP handler.

func CustomHTTPErrorHandler

func CustomHTTPErrorHandler(trans ut.Translator) echo.HTTPErrorHandler

CustomHTTPErrorHandler handles errors encountered during HTTP request processing.

Types

type CustomBinder

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

CustomBinder struct.

func NewBinder

func NewBinder() *CustomBinder

NewBinder initializes custom server binder.

func (*CustomBinder) Bind

func (cb *CustomBinder) Bind(i interface{}, c echo.Context) error

Bind tries to bind request into interface, and if it does then validate it.

type CustomValidator

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

CustomValidator holds custom validator.

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

Validate performs field validation.

type Server

type Server struct {
	Echo *echo.Echo // HTTP middleware
	// contains filtered or unexported fields
}

Server represents our server, it include all dependencies and make it easy to understand what the server needs.

Jump to

Keyboard shortcuts

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