http

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 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 Config

type Config struct {
	Host              string
	Port              string
	TemplatesBasePath string
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	DialTimeout       time.Duration
}

Config holds all the configuration required to start the HTTP server

type HTTP

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

HTTP struct holds all the dependencies required for starting HTTP server

func NewService

func NewService(cfg *Config, a *api.API) (*HTTP, error)

NewService returns an instance of HTTP with all its dependencies set

func (*HTTP) Start

func (h *HTTP) Start()

Start starts the HTTP server

type Handlers

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

Handlers struct has all the dependencies required for HTTP handlers

func (*Handlers) CreateUser

func (h *Handlers) CreateUser(w http.ResponseWriter, r *http.Request) error

CreateUser is the HTTP handler to create a new user This handler does not use any framework, instead just the standard library

func (*Handlers) Health

func (h *Handlers) Health(w http.ResponseWriter, r *http.Request) error

Health is the HTTP handler to return the status of the app including the version, and other details This handler uses webgo to respond to the http request

func (*Handlers) HelloWorld

func (h *Handlers) HelloWorld(w http.ResponseWriter, r *http.Request) error

HelloWorld is a helloworld HTTP handler

func (*Handlers) ReadUserByEmail

func (h *Handlers) ReadUserByEmail(w http.ResponseWriter, r *http.Request) error

ReadUserByEmail is the HTTP handler to read an existing user by email

Jump to

Keyboard shortcuts

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