hello

package
v0.0.0-...-105f62c Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 6 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 {
	ServeAddress string `default:":3333" split_words:"true"`
}

Config - hello app configs

func GetConfig

func GetConfig() *Config

GetConfig - returns hello app config

type Context

type Context struct {
	Config *Config
}

Context - is struct containing all needed things to handle requests it also contains config and may contain connection objects to databases

func GetContext

func GetContext(cfg *Config) (*Context, error)

GetContext - returns new context based on config in real apps this method will try to connect to databases and configure other dependent services

func (*Context) HelloHandler

func (ctx *Context) HelloHandler(w http.ResponseWriter, r *http.Request)

HelloHandler - simple http handler

func (*Context) LivenessHealthcheckHandler

func (ctx *Context) LivenessHealthcheckHandler(w http.ResponseWriter, r *http.Request)

LivenessHealthcheckHandler - dumb healthcheck method

func (*Context) ReadinessHealthcheckHandler

func (ctx *Context) ReadinessHealthcheckHandler(w http.ResponseWriter, r *http.Request)

ReadinessHealthcheckHandler - dumb healthcheck method

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

Server - struct for managing http server

func NewServer

func NewServer(ctx *Context) *Server

NewServer - create new instance of server

Jump to

Keyboard shortcuts

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