go_bo

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 7 Imported by: 0

README

go-bo

lib for create configurations and routers(by chi)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigYAML

func GetConfigYAML(filepath string, dest interface{}) error

GetConfigYAML initialize configuration by path

func HelloWorldExample

func HelloWorldExample(w http.ResponseWriter, r *http.Request)

Types

type Response

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

Response is a base container for application response

func NewResponse

func NewResponse() Response

func (*Response) Send

func (resp *Response) Send(w http.ResponseWriter, r *http.Request)

func (*Response) SetBody

func (r *Response) SetBody(body interface{}) *Response

func (*Response) SetCode

func (r *Response) SetCode(code int) *Response

func (*Response) SetHeader

func (r *Response) SetHeader(headerName string, headerContent string) *Response

type Router

type Router struct {
	chi.Router
}

func CreateRouter

func CreateRouter() *Router

func (*Router) Get

func (r *Router) Get(path string, handler func(http.ResponseWriter, *http.Request)) *Router

func (*Router) Post

func (r *Router) Post(path string, handler func(http.ResponseWriter, *http.Request)) *Router

Jump to

Keyboard shortcuts

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