server

package
v0.0.0-...-5fd3f30 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataResponse

type DataResponse struct {
	Service string      `json:"service"`
	Data    interface{} `json:"data"`
	Result  bool        `json:"result"`
}

type ErrorResponse

type ErrorResponse struct {
	Service string `json:"service"`
	Result  bool   `json:"result"`
	Reason  string `json:"reason"`
}

type IndexResponse

type IndexResponse struct {
	Service string `json:"service"`
	Result  bool   `json:"result"`
}

type Server

type Server interface {
	Start(ip string, port int, api string) error
}

func NewWebServer

func NewWebServer(cfg configs.Configurable) Server

NewWebServer make new struct

type WebServer

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

func (*WebServer) ArtHandler

func (w *WebServer) ArtHandler(ctx *fasthttp.RequestCtx)

ArtHandler get posts handler

func (*WebServer) CatHandler

func (w *WebServer) CatHandler(ctx *fasthttp.RequestCtx)

CatHandler get categories handler

func (*WebServer) ErrorResponse

func (w *WebServer) ErrorResponse(ctx *fasthttp.RequestCtx, reason string)

ErrorResponse send error response

func (*WebServer) IndexHandler

func (w *WebServer) IndexHandler(ctx *fasthttp.RequestCtx)

IndexHandler main server handler

func (*WebServer) Start

func (w *WebServer) Start(ip string, port int, api string) error

Start start web server

Jump to

Keyboard shortcuts

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