Documentation
¶
Overview ¶
Copyright (c) 2016, Julien Schmidt & Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distributiob.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permissiob.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURindexE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE indexSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2016, Gerasimos Maropoulos All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JULIEN SCHMIDT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index ¶
- Constants
- Variables
- func Close()
- func GetParamsLen(path string) uint8
- func Listen(fullHostOrPort ...string) error
- func ListenTLS(fullAddress string, certFile, keyFile string) error
- func Plugin(plugin IPlugin) error
- func ServeHTTP(res http.ResponseWriter, req *http.Request)
- func Templates(pathGlob string)
- func URLParam(req *http.Request, key string) string
- func URLParams(req *http.Request) url.Values
- func Use(handlers ...Handler)
- func UseFunc(handlersFn ...HandlerFunc)
- type Branch
- func (b *Branch) AddBranch(path string, middleware Middleware)
- func (b *Branch) AddNode(numParams uint8, path string, fullPath string, middleware Middleware)
- func (b *Branch) GetBranch(path string, _params PathParameters) (middleware Middleware, params PathParameters, mustRedirect bool)
- func (b *Branch) GivePrecedenceTo(index int) int
- type BranchCase
- type Context
- func (ctx *Context) Clone() *Context
- func (ctx *Context) Close()
- func (ctx *Context) Data(binaryData []byte)
- func (ctx *Context) Do()
- func (ctx *Context) End()
- func (ctx *Context) Get(key string) interface{}
- func (ctx *Context) GetCookie(name string) string
- func (ctx *Context) GetInt(key string) (value int)
- func (ctx *Context) GetRequest() *http.Request
- func (ctx *Context) GetResponseWriter() IMemoryWriter
- func (ctx *Context) GetString(key string) (value string)
- func (ctx *Context) HTML(htmlContents string)
- func (ctx *Context) IsStopped() bool
- func (ctx *Context) JSON(jsonObjectOrArray interface{}) error
- func (ctx *Context) New()
- func (ctx *Context) Next()
- func (ctx *Context) NotFound()
- func (ctx *Context) Panic()
- func (ctx *Context) Param(key string) string
- func (ctx *Context) ParamInt(key string) (int, error)
- func (ctx *Context) Redo(req *http.Request, res http.ResponseWriter)
- func (ctx *Context) Render(pageContext interface{}) error
- func (ctx *Context) RenderFile(file string, pageContext interface{}) error
- func (ctx *Context) RenderJSON(httpStatus int, jsonStructs ...interface{}) error
- func (ctx *Context) RequestIP() string
- func (ctx *Context) SendStatus(statusCode int, message string)
- func (ctx *Context) ServeFile(path string)
- func (ctx *Context) Set(key string, value interface{})
- func (ctx *Context) SetCookie(name string, value string)
- func (ctx *Context) SetRequest(req *http.Request)
- func (ctx *Context) SetResponseWriter(res IMemoryWriter)
- func (ctx *Context) Text(text string)
- func (ctx *Context) URLParam(key string) string
- func (ctx *Context) URLParamInt(key string) (int, error)
- func (ctx *Context) Write(format string, a ...interface{})
- func (ctx *Context) WriteData(httpStatus int, binaryData []byte)
- func (ctx *Context) WriteHTML(httpStatus int, htmlContents string)
- func (ctx *Context) WriteJSON(httpStatus int, jsonObjectOrArray interface{}) error
- func (ctx *Context) WriteText(httpStatus int, text string)
- func (ctx *Context) WriteXML(httpStatus int, xmlStructs ...interface{}) error
- func (ctx *Context) XML(xmlStructs ...interface{}) error
- type ErrorHandler
- type Garden
- type HTTPErrors
- type Handler
- type HandlerFunc
- type IBranch
- type IContext
- type IErrorHandler
- type IGarden
- type IHTTPErrors
- type IMemoryWriter
- type IMiddlewareSupporter
- type IParty
- type IPartyHoster
- type IPlugin
- type IPluginContainer
- type IRoute
- func Any(path string, handlersFn ...HandlerFunc) IRoute
- func Connect(path string, handlersFn ...HandlerFunc) IRoute
- func Delete(path string, handlersFn ...HandlerFunc) IRoute
- func Get(path string, handlersFn ...HandlerFunc) IRoute
- func Handle(method string, registedPath string, handlers ...Handler) IRoute
- func HandleAnnotated(irisHandler Handler) (IRoute, error)
- func HandleFunc(method string, path string, handlersFn ...HandlerFunc) IRoute
- func Head(path string, handlersFn ...HandlerFunc) IRoute
- func Options(path string, handlersFn ...HandlerFunc) IRoute
- func Patch(path string, handlersFn ...HandlerFunc) IRoute
- func Post(path string, handlersFn ...HandlerFunc) IRoute
- func Put(path string, handlersFn ...HandlerFunc) IRoute
- func Trace(path string, handlersFn ...HandlerFunc) IRoute
- type IRouter
- type IRouterCache
- type IRouterMethods
- type IStation
- type ITick
- type ITree
- type MemoryRouter
- type MemoryRouterCache
- type MemoryWriter
- func (m *MemoryWriter) CloseNotify() <-chan bool
- func (m *MemoryWriter) Flush()
- func (m *MemoryWriter) ForceHeader()
- func (m *MemoryWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (m *MemoryWriter) IsWritten() bool
- func (m *MemoryWriter) New(underlineRes http.ResponseWriter)
- func (m *MemoryWriter) Size() int
- func (m *MemoryWriter) Status() int
- func (m *MemoryWriter) Write(data []byte) (int, error)
- func (m *MemoryWriter) WriteHeader(statusCode int)
- type Middleware
- type MiddlewareSupporter
- type PathParameter
- type PathParameters
- type PluginContainer
- func (p *PluginContainer) DoPostHandle(method string, route IRoute)
- func (p *PluginContainer) DoPostListen(station *Station, err error)
- func (p *PluginContainer) DoPreClose(station *Station)
- func (p *PluginContainer) DoPreHandle(method string, route IRoute)
- func (p *PluginContainer) DoPreListen(station *Station)
- func (p *PluginContainer) GetByName(pluginName string) IPlugin
- func (p *PluginContainer) Plugin(plugin IPlugin) error
- func (p *PluginContainer) Printf(format string, a ...interface{})
- func (p *PluginContainer) RemovePlugin(pluginName string)
- type Route
- type Router
- func (r *Router) Any(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Connect(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Delete(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Errors() IHTTPErrors
- func (r *Router) Get(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Handle(method string, registedPath string, handlers ...Handler) IRoute
- func (r *Router) HandleAnnotated(irisHandler Handler) (IRoute, error)
- func (r *Router) HandleFunc(method string, registedPath string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Head(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Options(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Party(rootPath string) IParty
- func (r *Router) Patch(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Post(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) Put(path string, handlersFn ...HandlerFunc) IRoute
- func (r *Router) ServeHTTP(res http.ResponseWriter, req *http.Request)
- func (r *Router) SetErrors(httperr IHTTPErrors)
- func (r *Router) Trace(path string, handlersFn ...HandlerFunc) IRoute
- type Server
- type Station
- func (s *Station) Close()
- func (s Station) GetPluginContainer() IPluginContainer
- func (s Station) GetPool() *sync.Pool
- func (s Station) GetTemplates() *template.Template
- func (s *Station) Listen(fullHostOrPort ...string) error
- func (s *Station) ListenTLS(fullAddress string, certFile, keyFile string) error
- func (s *Station) Plugin(plugin IPlugin) error
- func (s *Station) Templates(pathGlob string)
- type StationOptions
- type Ticker
Constants ¶
const ( // DefaultCharset represents the default charset for content headers DefaultCharset = "UTF-8" // ContentType represents the header["Content-Type"] ContentType = "Content-Type" // ContentLength represents the header["Content-Length"] ContentLength = "Content-Length" // ContentHTML is the string of text/html response headers ContentHTML = "text/html" // ContentJSON is the string of application/json response headers ContentJSON = "application/json" // ContentJSONP is the string of application/javascript response headers ContentJSONP = "application/javascript" // ContentBINARY is the string of "application/octet-stream response headers ContentBINARY = "application/octet-stream" // ContentTEXT is the string of text/plain response headers ContentTEXT = "text/plain" // ContentXML is the string of text/xml response headers ContentXML = "text/xml" )
const ( // ParameterStartByte is very used on the node, it's just contains the byte for the ':' rune/char ParameterStartByte = byte(':') // SlashByte is just a byte of '/' rune/char SlashByte = byte('/') // MatchEverythingByte is just a byte of '*" rune/char MatchEverythingByte = byte('*') )
const (
// DefaultProfilePath is the default path for the web pprof '/debug/pprof'
DefaultProfilePath = "/debug/pprof"
)
Variables ¶
var Charset = DefaultCharset
Charset is defaulted to UTF-8, you can change it all render methods will have this charset
var HTTPMethods = struct { GET, POST, PUT, DELETE, CONNECT, HEAD, PATCH, OPTIONS, TRACE string ALL, ANY []string //ALL and ANY are exctactly the same I keep both keys, no problem no big array :P }{"GET", "POST", "PUT", "DELETE", "CONNECT", "HEAD", "PATCH", "OPTIONS", "TRACE", []string{"GET", "POST", "PUT", "DELETE", "CONNECT", "HEAD", "PATCH", "OPTIONS", "TRACE"}, []string{"GET", "POST", "PUT", "DELETE", "CONNECT", "HEAD", "PATCH", "OPTIONS", "TRACE"}}
HTTPMethods is just a representation of the available http methods, use to make API. I know they are already exist in the http package, ex: http.MethodConnect, maybe at the future I will remove them from here and keep only the ANY.
Functions ¶
func Close ¶
func Close()
Close is used to close the net.Listener of the standalone http server which has already running via .Listen
func GetParamsLen ¶
func Listen ¶
Listen starts the standalone http server which listens to the fullHostOrPort parameter which as the form of host:port or just port or empty, the default is 127.0.0.1:8080
func ListenTLS ¶
ListenTLS Starts a httpS/http2 server with certificates, if you use this method the requests of the form of 'http://' will fail only https:// connections are allowed which listens to the fullHostOrPort parameter which as the form of host:port
func Plugin ¶
Plugin activates the plugins and if succeed then adds it to the activated plugins list
func ServeHTTP ¶
func ServeHTTP(res http.ResponseWriter, req *http.Request)
ServeHTTP serves an http request, with this function iris can be used also as a middleware into other already defined http server
func Templates ¶
func Templates(pathGlob string)
Templates sets the templates glob path for the web app
func URLParams ¶
URLParams the URL.Query() is a complete function which returns the url get parameters from the url query, We don't have to do anything else here.
func Use ¶
func Use(handlers ...Handler)
Use appends a middleware to the route or to the router if it's called from router
func UseFunc ¶
func UseFunc(handlersFn ...HandlerFunc)
UseFunc same as Use but it accepts/receives ...HandlerFunc instead of ...Handler form of acceptable: func(c *iris.Context){//first middleware}, func(c *iris.Context){//second middleware}
Types ¶
type Branch ¶
type Branch struct { BranchCase BranchCase // contains filtered or unexported fields }
func (*Branch) AddBranch ¶
func (b *Branch) AddBranch(path string, middleware Middleware)
func (*Branch) AddNode ¶
func (b *Branch) AddNode(numParams uint8, path string, fullPath string, middleware Middleware)
func (*Branch) GetBranch ¶
func (b *Branch) GetBranch(path string, _params PathParameters) (middleware Middleware, params PathParameters, mustRedirect bool)
func (*Branch) GivePrecedenceTo ¶
type BranchCase ¶
type BranchCase uint8
type Context ¶
type Context struct { ResponseWriter IMemoryWriter Request *http.Request Params PathParameters // contains filtered or unexported fields }
Context is resetting every time a request is coming to the server, it holds a pointer to the http.Request, the ResponseWriter the Named Parameters (if any) of the requested path and an underline Renderer.
func (*Context) Clone ¶
Clone before we had (c Context) inscope and (c *Context) for outscope like goroutines now we have (c *Context) for both sittuations ,and call .Clone() if we need to pass the context in a gorotoune or to a time func example:
api.Get("/user/:id", func(ctx *iris.Context) { c:= ctx.Clone() time.AfterFunc(20 * time.Second, func() { println(" 20 secs after: from user with id:", c.Param("id"), " context req path:", c.Request.URL.Path) }) })
func (*Context) Close ¶
func (ctx *Context) Close()
Close is used to close the body of the request /TODO: CHECK FOR REQUEST CLOSED IN ORDER TO FIX SOME ERRORS HERE
func (*Context) Do ¶
func (ctx *Context) Do()
do calls the first handler only, it's like Next with negative pos, used only on Router&MemoryRouter
func (*Context) GetRequest ¶
func (*Context) GetResponseWriter ¶
func (ctx *Context) GetResponseWriter() IMemoryWriter
func (*Context) Next ¶
func (ctx *Context) Next()
Next calls all the next handler from the middleware stack, it used inside a middleware
func (*Context) NotFound ¶
func (ctx *Context) NotFound()
NotFound emits an error 404 to the client, using the custom http errors if no custom errors provided then use the default http.NotFound which is already registed nothing special to do here
func (*Context) Panic ¶
func (ctx *Context) Panic()
Panic stops the executions of the context and returns a http status to the client
func (*Context) Param ¶
Param returns the string representation of the key's path named parameter's value
func (*Context) ParamInt ¶
ParamInt returns the int representation of the key's path named parameter's value
func (*Context) Render ¶
Render renders the template file html which is already registed to the template cache, with it's pageContext passed to the function
func (*Context) RenderFile ¶
RenderFile renders a file by its path and a context passed to the function
func (*Context) RenderJSON ¶
RenderJSON renders json objects with indent
func (*Context) SendStatus ¶
SendStatus sends a http status to the client it receives status code (int) and a message (string)
func (*Context) SetRequest ¶
func (*Context) SetResponseWriter ¶
func (ctx *Context) SetResponseWriter(res IMemoryWriter)
func (*Context) URLParamInt ¶
URLParamInt returns the get parameter int value from a request , if any
func (*Context) WriteHTML ¶
WriteHTML writes html string with a http status /TODO or I will think to pass an interface on handlers as second parameter near to the Context, with developer's custom Renderer package .. I will think about it.
func (*Context) WriteJSON ¶
WriteJSON writes JSON which is encoded from a single json object or array with no Indent
type ErrorHandler ¶
type ErrorHandler struct {
// contains filtered or unexported fields
}
ErrorHandlers just an array of struct{ code int, handler http.Handler}
func (ErrorHandler) GetCode ¶
func (e ErrorHandler) GetCode() int
func (ErrorHandler) GetHandler ¶
func (e ErrorHandler) GetHandler() HandlerFunc
func (*ErrorHandler) SetHandler ¶
func (e *ErrorHandler) SetHandler(h HandlerFunc)
type Garden ¶
type Garden []tree // node here is the root node
Garden is the main area which routes are planted/placed
func (Garden) GetByMethod ¶
type HTTPErrors ¶
type HTTPErrors struct { //developer can do Errors.On(500, iris.Handler) ErrorHanders []IErrorHandler }
HTTPErrors is the struct which contains the handlers which will execute if http error occurs One struct per Server instance, the meaning of this is that the developer can change the default error message and replace them with his/her own completely custom handlers
func (*HTTPErrors) Emit ¶
func (he *HTTPErrors) Emit(errCode int, ctx *Context)
Emit executes the handler of the given error http status code
func (*HTTPErrors) GetByCode ¶
func (he *HTTPErrors) GetByCode(httpStatus int) IErrorHandler
func (*HTTPErrors) NotFound ¶
func (he *HTTPErrors) NotFound(ctx *Context)
NotFound emits the registed NotFound (404) custom (or not) handler
func (*HTTPErrors) On ¶
func (he *HTTPErrors) On(httpStatus int, handler HandlerFunc)
On Registers a handler for a specific http error status ( overrides the NotFound and MethodNotAllowed)
func (*HTTPErrors) SetNotFound ¶
func (he *HTTPErrors) SetNotFound(handler HandlerFunc)
SetNotFound this func could named it OnNotFound also, registers a custom StatusNotFound error 404 handler Possible parameter: iris.Handler or iris.HandlerFunc(func(ctx *Context){})
type Handler ¶
type Handler interface {
Serve(ctx *Context)
}
Handler the main Iris Handler interface.
func ConvertToHandlers ¶
func ConvertToHandlers(handlersFn []HandlerFunc) []Handler
convertToHandlers accepts list of HandlerFunc and returns list of Handler this can be renamed to convertToMiddleware also because it returns a list of []Handler which is what Middleware is
type HandlerFunc ¶
type HandlerFunc func(*Context)
HandlerFunc type is an adapter to allow the use of ordinary functions as HTTP handlers. If f is a function with the appropriate signature, HandlerFunc(f) is a Handler that calls f.
func ErrorHandlerFunc ¶
func ErrorHandlerFunc(statusCode int, message string) HandlerFunc
ErrorHandler creates a handler which is responsible to send a particular error to the client
func Static ¶
func Static(SystemPath string, PathToStrip ...string) HandlerFunc
Static is just a function which returns a HandlerFunc with the standar http's fileserver's handler It is not a middleware, it just returns a HandlerFunc to use anywhere we want
func ToHandlerFunc ¶
func ToHandlerFunc(handler interface{}) HandlerFunc
ToHandlerFunc converts http.Handler or func(http.ResponseWriter, *http.Request) to an iris.HandlerFunc func (ctx *Context)
func (HandlerFunc) Serve ¶
func (h HandlerFunc) Serve(ctx *Context)
Serve serves the handler, is like ServeHTTP for Iris
type IBranch ¶
type IBranch interface { AddBranch(string, Middleware) AddNode(uint8, string, string, Middleware) GetBranch(string, PathParameters) (Middleware, PathParameters, bool) GivePrecedenceTo(index int) int }
type IContext ¶
type IContext interface { New() Do() Redo(req *http.Request, res http.ResponseWriter) Next() GetResponseWriter() IMemoryWriter GetRequest() *http.Request Param(key string) string ParamInt(key string) (int, error) URLParam(key string) string URLParamInt(key string) (int, error) Get(key string) interface{} GetString(key string) (value string) GetInt(key string) (value int) Set(key string, value interface{}) Write(format string, a ...interface{}) ServeFile(path string) GetCookie(name string) string SetCookie(name string, value string) NotFound() SendStatus(statusCode int, message string) Panic() RequestIP() string Close() End() IsStopped() bool Clone() *Context ///todo IContext again RenderFile(file string, pageContext interface{}) error Render(pageContext interface{}) error WriteHTML(httpStatus int, htmlContents string) HTML(htmlContents string) WriteData(httpStatus int, binaryData []byte) Data(binaryData []byte) WriteText(httpStatus int, text string) Text(text string) RenderJSON(httpStatus int, jsonStructs ...interface{}) error WriteJSON(httpStatus int, jsonObjectOrArray interface{}) error JSON(jsonObjectOrArray interface{}) error WriteXML(httpStatus int, xmlStructs ...interface{}) error XML(xmlStructs ...interface{}) error }
type IErrorHandler ¶
type IErrorHandler interface { GetCode() int GetHandler() HandlerFunc SetHandler(h HandlerFunc) }
type IHTTPErrors ¶
type IHTTPErrors interface { GetByCode(httpStatus int) IErrorHandler On(httpStatus int, handler HandlerFunc) SetNotFound(handler HandlerFunc) Emit(errCode int, ctx *Context) NotFound(ctx *Context) }
func DefaultHTTPErrors ¶
func DefaultHTTPErrors() IHTTPErrors
DefaultHTTPErrors creates and returns an instance of HTTPErrors with default handlers
type IMemoryWriter ¶
type IMemoryWriter interface { http.ResponseWriter http.Hijacker http.CloseNotifier Size() int Status() int // IsWritten() bool ForceHeader() }
type IMiddlewareSupporter ¶
type IMiddlewareSupporter interface { Use(handlers ...Handler) UseFunc(handlersFn ...HandlerFunc) JoinMiddleware(middleware Middleware) Middleware }
IMiddlewareSupporter is an interface which all routers must implement
type IParty ¶
type IParty interface { IRouterMethods IPartyHoster IMiddlewareSupporter SetParentHosterMiddleware(m Middleware) }
IParty is the interface which implements the whole Party of routes
type IPartyHoster ¶
IPartyHoster is the interface which implements the Party func
type IPlugin ¶
type IPlugin interface { // GetName has to returns the name of the plugin, a name is unique // name has to be not dependent from other methods of the plugin, // because it is being called even before the Activate GetName() string // GetDescription has to returns the description of what the plugins is used for GetDescription() string // Activate called BEFORE the plugin being added to the plugins list, // if Activate returns none nil error then the plugin is not being added to the list // it is being called only one time // // PluginContainer parameter used to add other plugins if that's necessary by the plugin Activate(IPluginContainer) error // PreHandle it's being called every time BEFORE a Route is registed to the Router // // first parameter is the HTTP method // second is the Route PreHandle(string, IRoute) // PostHandle it's being called every time AFTER a Route successfully registed to the Router // // first parameter is the HTTP method // second is the Route PostHandle(string, IRoute) // PreListen it's being called only one time, BEFORE the Server is started (if .Listen called) // is used to do work at the time all other things are ready to go PreListen(*Station) // PostListen it's being called only one time, AFTER the Server is started (if .Listen called) // is used to do work when the server is running PostListen(*Station, error) // PreClose it's being called only one time, BEFORE the Iris .Close method // any plugin cleanup/clear memory happens here // // The plugin is deactivated after this state PreClose(*Station) }
IPlugin is the interface which all Plugins must implement.
A Plugin can register other plugins also from it's Activate state
type IPluginContainer ¶
type IPluginContainer interface { Plugin(plugin IPlugin) error RemovePlugin(pluginName string) GetByName(pluginName string) IPlugin Printf(format string, a ...interface{}) DoPreHandle(method string, route IRoute) DoPostHandle(method string, route IRoute) DoPreListen(station *Station) DoPostListen(station *Station, err error) DoPreClose(station *Station) }
type IRoute ¶
type IRoute interface { ProcessPath() GetPath() string GetPathPrefix() string GetMiddleware() Middleware SetMiddleware(m Middleware) }
func Any ¶
func Any(path string, handlersFn ...HandlerFunc) IRoute
Any registers a route for ALL of the http methods (Get,Post,Put,Head,Patch,Options,Connect,Delete)
func Connect ¶
func Connect(path string, handlersFn ...HandlerFunc) IRoute
Connect registers a route for the Connect http method
func Delete ¶
func Delete(path string, handlersFn ...HandlerFunc) IRoute
Delete registers a route for the Delete http method
func Get ¶
func Get(path string, handlersFn ...HandlerFunc) IRoute
Get registers a route for the Get http method
func HandleAnnotated ¶
HandleAnnotated registers a route handler using a Struct implements iris.Handler (as anonymous property) which it's metadata has the form of `method:"path"` and returns the route and an error if any occurs handler is passed by func(urstruct MyStruct) Serve(ctx *Context) {}
func HandleFunc ¶
func HandleFunc(method string, path string, handlersFn ...HandlerFunc) IRoute
HandleFunc registers a route with a method, path string, and a handler
func Head ¶
func Head(path string, handlersFn ...HandlerFunc) IRoute
Head registers a route for the Head http method
func Options ¶
func Options(path string, handlersFn ...HandlerFunc) IRoute
Options registers a route for the Options http method
func Patch ¶
func Patch(path string, handlersFn ...HandlerFunc) IRoute
Patch registers a route for the Patch http method
func Post ¶
func Post(path string, handlersFn ...HandlerFunc) IRoute
Post registers a route for the Post http method
func Put ¶
func Put(path string, handlersFn ...HandlerFunc) IRoute
Put registers a route for the Put http method
func Trace ¶
func Trace(path string, handlersFn ...HandlerFunc) IRoute
Trace registers a route for the Trace http methodd
type IRouter ¶
type IRouter interface { IMiddlewareSupporter IRouterMethods IPartyHoster HandleAnnotated(Handler) (IRoute, error) Handle(string, string, ...Handler) IRoute HandleFunc(string, string, ...HandlerFunc) IRoute Errors() IHTTPErrors //at the main Router struct this is managed by the MiddlewareSupporter // ServeHTTP finds and serves a route by it's request // If no route found, it sends an http status 404 ServeHTTP(http.ResponseWriter, *http.Request) }
IRouter is the interface of which any Iris router must implement
type IRouterCache ¶
type IRouterCache interface { OnTick() AddItem(method, url string, ctx *Context) GetItem(method, url string) *Context SetMaxItems(maxItems int) }
IRouterCache is the interface which the MemoryRouter implements
type IRouterMethods ¶
type IRouterMethods interface { Get(path string, handlersFn ...HandlerFunc) IRoute Post(path string, handlersFn ...HandlerFunc) IRoute Put(path string, handlersFn ...HandlerFunc) IRoute Delete(path string, handlersFn ...HandlerFunc) IRoute Connect(path string, handlersFn ...HandlerFunc) IRoute Head(path string, handlersFn ...HandlerFunc) IRoute Options(path string, handlersFn ...HandlerFunc) IRoute Patch(path string, handlersFn ...HandlerFunc) IRoute Trace(path string, handlersFn ...HandlerFunc) IRoute Any(path string, handlersFn ...HandlerFunc) IRoute }
IRouterMethods is the interface for method routing
type ITick ¶
type ITick interface {
OnTick()
}
ITick is the interface which all ticker's listeners must implement
type MemoryRouter ¶
type MemoryRouter struct { *Router // contains filtered or unexported fields }
MemoryRouter is the cached version of the Router
func NewMemoryRouter ¶
func NewMemoryRouter(underlineRouter *Router, maxitems int, resetDuration time.Duration) *MemoryRouter
NewMemoryRouter returns a MemoryRouter receives an underline *Router object and int options like MaxItems and ResetDurationTime
func (*MemoryRouter) ServeHTTP ¶
func (r *MemoryRouter) ServeHTTP(res http.ResponseWriter, req *http.Request)
ServeHTTP calls processRequest which finds and serves a route by it's request If no route found, it sends an http status 404 with a custom error middleware, if setted
type MemoryRouterCache ¶
type MemoryRouterCache struct { MaxItems int // contains filtered or unexported fields }
MemoryRouterCache creation done with just &MemoryRouterCache{}
func NewMemoryRouterCache ¶
func NewMemoryRouterCache() *MemoryRouterCache
NewMemoryRouterCache returns the cache for a router, is used on the MemoryRouter
func (*MemoryRouterCache) AddItem ¶
func (mc *MemoryRouterCache) AddItem(method, url string, ctx *Context)
AddItem adds an item to the bag/cache, is a goroutine.
func (*MemoryRouterCache) GetItem ¶
func (mc *MemoryRouterCache) GetItem(method, url string) *Context
GetItem returns an item from the bag/cache, if not exists it returns just nil.
func (*MemoryRouterCache) OnTick ¶
func (mc *MemoryRouterCache) OnTick()
OnTick is the implementation of the ITick it makes the MemoryRouterCache a ticker's listener
func (*MemoryRouterCache) SetMaxItems ¶
func (mc *MemoryRouterCache) SetMaxItems(_itemslen int)
SetMaxItems receives int and set max cached items to this number
type MemoryWriter ¶
type MemoryWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func (*MemoryWriter) CloseNotify ¶
func (m *MemoryWriter) CloseNotify() <-chan bool
func (*MemoryWriter) Flush ¶
func (m *MemoryWriter) Flush()
func (*MemoryWriter) ForceHeader ¶
func (m *MemoryWriter) ForceHeader()
func (*MemoryWriter) Hijack ¶
func (m *MemoryWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*MemoryWriter) IsWritten ¶
func (m *MemoryWriter) IsWritten() bool
func (*MemoryWriter) New ¶
func (m *MemoryWriter) New(underlineRes http.ResponseWriter)
func (*MemoryWriter) Size ¶
func (m *MemoryWriter) Size() int
func (*MemoryWriter) Status ¶
func (m *MemoryWriter) Status() int
func (*MemoryWriter) WriteHeader ¶
func (m *MemoryWriter) WriteHeader(statusCode int)
type Middleware ¶
type Middleware []Handler
Middleware is just a slice of Handler []func(c *Context)
type MiddlewareSupporter ¶
type MiddlewareSupporter struct {
Middleware Middleware
}
MiddlewareSupporter is the struch which make the Imiddlewaresupporter's works, is useful only to no repeat the code of middleware
func (MiddlewareSupporter) JoinMiddleware ¶
func (m MiddlewareSupporter) JoinMiddleware(middleware Middleware) Middleware
joinMiddleware uses to create a copy of all middleware and return them in order to use inside the node
func (MiddlewareSupporter) Use ¶
func (m MiddlewareSupporter) Use(handlers ...Handler)
Use appends handler(s) to the route or to the router if it's called from router
func (MiddlewareSupporter) UseFunc ¶
func (m MiddlewareSupporter) UseFunc(handlersFn ...HandlerFunc)
UseFunc is the same as Use but it receives HandlerFunc instead of iris.Handler as parameter(s) form of acceptable: func(c *iris.Context){//first middleware}, func(c *iris.Context){//second middleware}
type PathParameter ¶
PathParameter is a struct which contains Key and Value, used for named path parameters
type PathParameters ¶
type PathParameters []PathParameter
PathParameters type for a slice of PathParameter Tt's a slice of PathParameter type, because it's faster than map
func ParseParams ¶
func ParseParams(str string) PathParameters
ParseParams receives a string and returns PathParameters (slice of PathParameter) received string must have this form: key1=value1,key2=value2...
func (PathParameters) Get ¶
func (params PathParameters) Get(key string) string
Get returns a value from a key inside this Parameters If no parameter with this key given then it returns an empty string
func (PathParameters) Set ¶
func (params PathParameters) Set(key string, value string)
Set sets a PathParameter to the PathParameters , it's not used anywhere.
func (PathParameters) String ¶
func (params PathParameters) String() string
String returns a string implementation of all parameters that this PathParameters object keeps hasthe form of key1=value1,key2=value2...
type PluginContainer ¶
type PluginContainer struct {
// contains filtered or unexported fields
}
PluginContainer is the base container of all Iris, registed plugins
func (*PluginContainer) DoPostHandle ¶
func (p *PluginContainer) DoPostHandle(method string, route IRoute)
func (*PluginContainer) DoPostListen ¶
func (p *PluginContainer) DoPostListen(station *Station, err error)
func (*PluginContainer) DoPreClose ¶
func (p *PluginContainer) DoPreClose(station *Station)
func (*PluginContainer) DoPreHandle ¶
func (p *PluginContainer) DoPreHandle(method string, route IRoute)
func (*PluginContainer) DoPreListen ¶
func (p *PluginContainer) DoPreListen(station *Station)
func (*PluginContainer) GetByName ¶
func (p *PluginContainer) GetByName(pluginName string) IPlugin
GetByName returns a plugin instance by it's name
func (*PluginContainer) Plugin ¶
func (p *PluginContainer) Plugin(plugin IPlugin) error
Plugin activates the plugins and if succeed then adds it to the activated plugins list
func (*PluginContainer) Printf ¶
func (p *PluginContainer) Printf(format string, a ...interface{})
Printf sends plain text to any registed logger (future), some plugins maybe want use this method maybe at the future I change it, instead of sync even-driven to async channels...
func (*PluginContainer) RemovePlugin ¶
func (p *PluginContainer) RemovePlugin(pluginName string)
RemovePlugin DOES NOT calls the plugin.PreClose method but it removes it completely from the plugins list
type Route ¶
type Route struct { PathPrefix string // contains filtered or unexported fields }
Route contains basic and temporary info about the route, it is nil after iris.Listen called contains all middleware and prepare them for execution Used to create a node at the Router's Build state
func NewRoute ¶
func NewRoute(registedPath string, middleware Middleware) *Route
newRoute creates, from a path string, and a slice of HandlerFunc
func (Route) GetMiddleware ¶
func (r Route) GetMiddleware() Middleware
func (Route) GetPathPrefix ¶
func (*Route) ProcessPath ¶
func (r *Route) ProcessPath()
func (Route) SetMiddleware ¶
func (r Route) SetMiddleware(m Middleware)
type Router ¶
type Router struct { MiddlewareSupporter // contains filtered or unexported fields }
Router is the router , one router per server. Router contains the global middleware, the routes and a Mutex for lock and unlock on route prepare
func (*Router) Any ¶
func (r *Router) Any(path string, handlersFn ...HandlerFunc) IRoute
Any registers a route for ALL of the http methods (Get,Post,Put,Head,Patch,Options,Connect,Delete)
func (*Router) Connect ¶
func (r *Router) Connect(path string, handlersFn ...HandlerFunc) IRoute
Connect registers a route for the Connect http method
func (*Router) Delete ¶
func (r *Router) Delete(path string, handlersFn ...HandlerFunc) IRoute
Delete registers a route for the Delete http method
func (*Router) Errors ¶
func (r *Router) Errors() IHTTPErrors
Errors get the HTTPErrors from the router
func (*Router) Get ¶
func (r *Router) Get(path string, handlersFn ...HandlerFunc) IRoute
Get registers a route for the Get http method
func (*Router) HandleAnnotated ¶
HandleAnnotated registers a route handler using a Struct implements iris.Handler (as anonymous property) which it's metadata has the form of `method:"path"` and returns the route and an error if any occurs handler is passed by func(urstruct MyStruct) Serve(ctx *Context) {}
func (*Router) HandleFunc ¶
func (r *Router) HandleFunc(method string, registedPath string, handlersFn ...HandlerFunc) IRoute
HandleFunc registers and returns a route with a method string, path string and a handler registedPath is the relative url path handler is the iris.Handler which you can pass anything you want via iris.ToHandlerFunc(func(res,req){})... or just use func(c *iris.Context)
func (*Router) Head ¶
func (r *Router) Head(path string, handlersFn ...HandlerFunc) IRoute
Head registers a route for the Head http method
func (*Router) Options ¶
func (r *Router) Options(path string, handlersFn ...HandlerFunc) IRoute
Options registers a route for the Options http method
func (*Router) Party ¶
Party is just a group joiner of routes which have the same prefix and share same middleware(s) also. Party can also be named as 'Join' or 'Node' or 'Group' , Party chosen because it has more fun
func (*Router) Patch ¶
func (r *Router) Patch(path string, handlersFn ...HandlerFunc) IRoute
Patch registers a route for the Patch http method
func (*Router) Post ¶
func (r *Router) Post(path string, handlersFn ...HandlerFunc) IRoute
Post registers a route for the Post http method
func (*Router) Put ¶
func (r *Router) Put(path string, handlersFn ...HandlerFunc) IRoute
Put registers a route for the Put http method
func (*Router) ServeHTTP ¶
func (r *Router) ServeHTTP(res http.ResponseWriter, req *http.Request)
ServeHTTP finds and serves a route by it's request If no route found, it sends an http status 404
func (*Router) SetErrors ¶
func (r *Router) SetErrors(httperr IHTTPErrors)
SetErrors sets a HTTPErrors object to the router
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the container of the tcp listener used to start an http server,
it holds it's router and it's config, also a property named isRunning which can be used to see if the server is already running or not.
Server's New() located at the iris.go file
type Station ¶
type Station struct { IRouter // contains filtered or unexported fields }
Station is the container of all, server, router, cache and the sync.Pool
var (
DefaultStation *Station
)
iris.go exposes the default global (iris.) public API from the New() default station
func Custom ¶
func Custom(options StationOptions) *Station
Custom is used for iris-experienced developers creates and returns a new iris Station with custom StationOptions
func (*Station) Close ¶
func (s *Station) Close()
Close is used to close the tcp listener from the server
func (Station) GetPluginContainer ¶
func (s Station) GetPluginContainer() IPluginContainer
func (Station) GetTemplates ¶
func (*Station) Listen ¶
Listen starts the standalone http server which listens to the fullHostOrPort parameter which as the form of host:port or just port
func (*Station) ListenTLS ¶
ListenTLS Starts a httpS/http2 server with certificates, if you use this method the requests of the form of 'http://' will fail only https:// connections are allowed which listens to the fullHostOrPort parameter which as the form of host:port or just port
type StationOptions ¶
type StationOptions struct { // Profile set to true to enable web pprof (debug profiling) // Default is false, enabling makes available these 7 routes: // /debug/pprof/cmdline // /debug/pprof/profile // /debug/pprof/symbol // /debug/pprof/goroutine // /debug/pprof/heap // /debug/pprof/threadcreate // /debug/pprof/pprof/block Profile bool // ProfilePath change it if you want other url path than the default // Default is /debug/pprof , which means yourhost.com/debug/pprof ProfilePath string // Cache for Router, change it to false if you don't want to use the cache mechanism that Iris provides for your routes Cache bool // CacheMaxItems max number of total cached routes, 500 = +~20000 bytes = ~0.019073MB // Every time the cache timer reach this number it will reset/clean itself // Default is 0 // If <=0 then cache cleans all of items (bag) // Auto cache clean is happening after 5 minutes the last request serve, you can change this number by 'ResetDuration' property // Note that MaxItems doesn't means that the items never reach this lengh, only on timer tick this number is checked/consider. CacheMaxItems int // CacheResetDuration change this time.value to determinate how much duration after last request serving the cache must be reseted/cleaned // Default is 5 * time.Minute , Minimum is 30 seconds // // If CacheMaxItems <= 0 then it clears the whole cache bag at this duration. CacheResetDuration time.Duration // PathCorrection corrects and redirects the requested path to the registed path // for example, if /home/ path is requested but no handler for this Route found, // then the Router checks if /home handler exists, if yes, redirects the client to the correct path /home // and VICE - VERSA if /home/ is registed but /home is requested then it redirects to /home/ // // Default is true PathCorrection bool }
StationOptions is the struct which contains all Iris' settings/options
type Ticker ¶
type Ticker struct {
// contains filtered or unexported fields
}
Ticker is the timer which is used in cache
func (*Ticker) OnTick ¶
func (c *Ticker) OnTick(h func())
OnTick add event handlers/ callbacks which are called on each timer's tick