Documentation
¶
Index ¶
- Constants
- Variables
- func Banner()
- func Version() et.Json
- type Handlers
- type HttpServer
- func (s *HttpServer) AddHandleMethod(method, path string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) AddRoute(method, path, resolve, kind, stage, packageName string) *Node
- func (s *HttpServer) Connect(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) Delete(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) Get(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) GetResolve(method, path string) *Resolve
- func (s *HttpServer) Handler(handlerFn http.HandlerFunc)
- func (s *HttpServer) HandlerWebSocket(handlerFn http.HandlerFunc)
- func (s *HttpServer) Head(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) MethodFunc(method, pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) NotFound(handlerFn http.HandlerFunc)
- func (s *HttpServer) Options(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) Patch(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) Post(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) Put(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) Trace(pattern string, handlerFn http.HandlerFunc, packageName string)
- func (s *HttpServer) With(next func(http.Handler) http.Handler) *HttpServer
- type Middleware
- type Node
- type Nodes
- type Pakage
- type Pakages
- type Resolute
- type Resolve
- type Server
- type Service
Constants ¶
const ( // Types HANDLER = "HANDLER" HTTP = "HTTP" REST = "REST" WEBSOCKET = "WEBSOCKET" // Methods CONNECT = "CONNECT" DELETE = "DELETE" GET = "GET" HEAD = "HEAD" OPTIONS = "OPTIONS" PATCH = "PATCH" POST = "POST" PUT = "PUT" TRACE = "TRACE" // PACKAGE_NAME = "Api Gateway" )
Variables ¶
var Company = envar.GetStr("", "COMPANY")
var Host = strs.Format(`%s:%d`, envar.GetStr("http://localhost", "HOST"), envar.GetInt(3300, "PORT"))
var HostName, _ = os.Hostname()
var PackageName = "gateway"
var PackagePath = envar.GetStr("/api/gateway", "PATH_URL")
var PackageTitle = envar.GetStr("Apigateway", "PACKAGE_TITLE")
var PackageVersion = envar.GetStr("0.0.1", "VERSION")
var Web = envar.GetStr("", "WEB")
Functions ¶
Types ¶
type Handlers ¶
type Handlers map[string]http.HandlerFunc
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func (*HttpServer) AddHandleMethod ¶
func (s *HttpServer) AddHandleMethod(method, path string, handlerFn http.HandlerFunc, packageName string)
func (*HttpServer) AddRoute ¶
func (s *HttpServer) AddRoute(method, path, resolve, kind, stage, packageName string) *Node
Add a route to the list
func (*HttpServer) Connect ¶
func (s *HttpServer) Connect(pattern string, handlerFn http.HandlerFunc, packageName string)
Connect adds the route `pattern` that matches `CONNECT` http method to
func (*HttpServer) Delete ¶
func (s *HttpServer) Delete(pattern string, handlerFn http.HandlerFunc, packageName string)
Delete adds the route `pattern` that matches `DELETE` http method to
func (*HttpServer) Get ¶
func (s *HttpServer) Get(pattern string, handlerFn http.HandlerFunc, packageName string)
Get adds the route `pattern` that matches `GET` http method to
func (*HttpServer) GetResolve ¶
func (s *HttpServer) GetResolve(method, path string) *Resolve
Get a route from the list
func (*HttpServer) Handler ¶
func (s *HttpServer) Handler(handlerFn http.HandlerFunc)
Handler sets the handler function for the server.
func (*HttpServer) HandlerWebSocket ¶
func (s *HttpServer) HandlerWebSocket(handlerFn http.HandlerFunc)
HandlerWebSocket sets the handler function for the server.
func (*HttpServer) Head ¶
func (s *HttpServer) Head(pattern string, handlerFn http.HandlerFunc, packageName string)
Head adds the route `pattern` that matches `HEAD` http method to
func (*HttpServer) MethodFunc ¶
func (s *HttpServer) MethodFunc(method, pattern string, handlerFn http.HandlerFunc, packageName string)
MethodFunc adds the route `pattern` that matches `method` http method to execute the `handlerFn` http.HandlerFunc.
func (*HttpServer) NotFound ¶
func (s *HttpServer) NotFound(handlerFn http.HandlerFunc)
NotFound sets the handler function for the server.
func (*HttpServer) Options ¶
func (s *HttpServer) Options(pattern string, handlerFn http.HandlerFunc, packageName string)
Options adds the route `pattern` that matches `OPTIONS` http method to
func (*HttpServer) Patch ¶
func (s *HttpServer) Patch(pattern string, handlerFn http.HandlerFunc, packageName string)
Patch adds the route `pattern` that matches `PATCH` http method to
func (*HttpServer) Post ¶
func (s *HttpServer) Post(pattern string, handlerFn http.HandlerFunc, packageName string)
Post adds the route `pattern` that matches `POST` http method to
func (*HttpServer) Put ¶
func (s *HttpServer) Put(pattern string, handlerFn http.HandlerFunc, packageName string)
Put adds the route `pattern` that matches `PUT` http method to
func (*HttpServer) Trace ¶
func (s *HttpServer) Trace(pattern string, handlerFn http.HandlerFunc, packageName string)
Trace adds the route `pattern` that matches `TRACE` http method to
func (*HttpServer) With ¶
func (s *HttpServer) With(next func(http.Handler) http.Handler) *HttpServer
type Resolute ¶
type Resolute struct {
Method string
Proto string
Path string
RawQuery string
Query url.Values
RequestURI string
RemoteAddr string
Header http.Header
Body io.ReadCloser
Host string
Scheme string
Resolve *Resolve
URL string
}