api

package
v0.0.0-...-2610577 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

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

HTTP exposes http api.

func NewHTTP

func NewHTTP(
	ctx context.Context,
	cfg *HTTPConfig,
	logger logger,
	sqldb *sql.DB,
	fetcher fetcher,
	emailClient emailSender,
	jwtService *jwt.Service,
) (*HTTP, error)

NewHTTP returns new http api.

func (*HTTP) ListenAndServe

func (h *HTTP) ListenAndServe(ctx context.Context) error

ListenAndServe stars http server.

func (*HTTP) Shutdown

func (h *HTTP) Shutdown(ctx context.Context) error

Shutdown gracefully stops the api.

type HTTPConfig

type HTTPConfig struct {
	Domain string
	Addr   string
	TLS    *TLSConfig
}

HTTPConfig is the http api configuration.

type TLSConfig

type TLSConfig struct {
	CertPath string
	KeyPath  string
}

TLSConfig contains ssl certificates.

Directories

Path Synopsis
db
db
db

Jump to

Keyboard shortcuts

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