Documentation ¶
Overview ¶
Copyright (c) 2013, Julien Schmidt 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 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 and Go Authors using for the 'log,io,os' packages 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 disclaimep.
- 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 THE COPYRIGHT HOLDER AND CONTRIBUTOR, GERASIMOS MAROPOULOS 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 Any(path string, handlersFn ...HandlerFunc)
- func Close()
- func Connect(path string, handlersFn ...HandlerFunc)
- func CorsMethodMatch(m1, reqMethod string) bool
- func Delete(path string, handlersFn ...HandlerFunc)
- func EmitError(statusCode int, ctx *Context)
- func Get(path string, handlersFn ...HandlerFunc)
- func GetParamsLen(path string) uint8
- func Handle(method string, registedPath string, handlers ...Handler)
- func HandleAnnotated(irisHandler Handler) error
- func HandleFunc(method string, path string, handlersFn ...HandlerFunc)
- func Head(path string, handlersFn ...HandlerFunc)
- func Listen(fullHostOrPort ...string) error
- func ListenTLS(fullAddress string, certFile, keyFile string) error
- func MethodMatch(m1, m2 string) bool
- func OnError(statusCode int, handlerFunc HandlerFunc)
- func OnNotFound(handlerFunc HandlerFunc)
- func OnPanic(handlerFunc HandlerFunc)
- func OptimusPrime()
- func Options(path string, handlersFn ...HandlerFunc)
- func ParseAddr(fullHostOrPort []string) string
- func Patch(path string, handlersFn ...HandlerFunc)
- func Plugin(plugin IPlugin) error
- func Post(path string, handlersFn ...HandlerFunc)
- func Put(path string, handlersFn ...HandlerFunc)
- func Serve() http.Handler
- func ServeHTTP(res http.ResponseWriter, req *http.Request)
- func Templates(pathGlob string)
- func Trace(path string, handlersFn ...HandlerFunc)
- func URLParam(req *http.Request, key string) string
- func URLParams(req *http.Request) url.Values
- func Use(handlers ...Handler)
- func UseFunc(handlersFn ...HandlerFunc)
- func Ws(path string, handler Handler)
- 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) Deadline() (deadline time.Time, ok bool)
- func (ctx *Context) Do()
- func (ctx *Context) Done() <-chan struct{}
- func (ctx *Context) EmitError(statusCode int)
- func (ctx *Context) End()
- func (ctx *Context) Err() error
- func (ctx *Context) Get(key string) interface{}
- func (ctx *Context) GetCookie(name string) string
- func (ctx *Context) GetFmt(key string) func(format string, args ...interface{}) string
- func (ctx *Context) GetHandlerName() string
- func (ctx *Context) GetInt(key string) (value int)
- func (ctx *Context) GetMemoryResponseWriter() MemoryWriter
- 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) 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) ReadJSON(jsonObject interface{}) error
- func (ctx *Context) ReadXML(xmlObject interface{}) error
- func (ctx *Context) Redirect(urlToRedirect string, statusHeader ...int) error
- func (ctx *Context) Redo(res http.ResponseWriter, req *http.Request)
- func (ctx *Context) RemoteAddr() string
- 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) RenderXML(httpStatus int, xmlStructs ...interface{}) error
- func (ctx *Context) RequestIP() string
- func (ctx *Context) Reset(res http.ResponseWriter, req *http.Request)
- 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) SetContentType(s []string)
- func (ctx *Context) SetCookie(name string, value string)
- func (ctx *Context) SetHeader(k string, s []string)
- func (ctx *Context) SetMemoryResponseWriter(res MemoryWriter)
- func (ctx *Context) SetRequest(req *http.Request)
- func (ctx *Context) SetResponseWriter(res IMemoryWriter)
- func (ctx *Context) StopExecution()
- func (ctx *Context) Text(text string)
- func (ctx *Context) URLParam(key string) string
- func (ctx *Context) URLParamInt(key string) (int, error)
- func (ctx *Context) Value(key interface{}) interface{}
- 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) WriteStatus(statusCode int)
- func (ctx *Context) WriteText(httpStatus int, text string)
- func (ctx *Context) WriteXML(httpStatus int, xmlB []byte) error
- func (ctx *Context) XML(xmlBytes []byte) error
- type ContextCache
- type DownloadManager
- func (d *DownloadManager) DirectoryExists(dir string) bool
- func (d *DownloadManager) DownloadZip(zipURL string, targetDir string) (string, error)
- func (d *DownloadManager) Install(remoteFileZip string, targetDirectory string) (string, error)
- func (d *DownloadManager) Remove(filePath string) error
- func (d *DownloadManager) Unzip(archive string, target string) (string, error)
- type ErrorHandler
- type Garden
- type GardenParty
- func (p *GardenParty) Any(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Connect(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Delete(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Get(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Handle(method string, registedPath string, handlers ...Handler)
- func (p *GardenParty) HandleAnnotated(irisHandler Handler) error
- func (p *GardenParty) HandleFunc(method string, registedPath string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Head(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Options(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Party(path string) IParty
- func (p *GardenParty) Patch(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Post(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Put(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Trace(path string, handlersFn ...HandlerFunc)
- func (p *GardenParty) Use(handlers ...Handler)
- func (p *GardenParty) Ws(path string, handler Handler)
- type HTTPErrors
- type Handler
- type HandlerFunc
- type IBranch
- type IContext
- type IContextCache
- type IDictionary
- type IDownloadManager
- type IErrorHandler
- type IHTTPErrors
- type IMemoryRouter
- type IMemoryWriter
- type IMiddlewareSupporter
- type IParty
- type IPlugin
- type IPluginContainer
- type IPluginPostHandle
- type IPluginPostListen
- type IPluginPreClose
- type IPluginPreDownload
- type IPluginPreHandle
- type IPluginPreListen
- type IRoute
- type IRouter
- type IStation
- type ITick
- type Logger
- type MemoryRouter
- type MemoryRouterDomain
- 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) Reset(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)
- func (m *MemoryWriter) WriteString(s string) (size int, err error)
- type Middleware
- type MiddlewareSupporter
- type PathParameter
- type PathParameters
- type PluginContainer
- func (p *PluginContainer) DoPostHandle(route IRoute)
- func (p *PluginContainer) DoPostListen(station *Station)
- func (p *PluginContainer) DoPreClose(station *Station)
- func (p *PluginContainer) DoPreDownload(pluginTryToDownload IPlugin, downloadURL string)
- func (p *PluginContainer) DoPreHandle(route IRoute)
- func (p *PluginContainer) DoPreListen(station *Station)
- func (p *PluginContainer) GetAll() []IPlugin
- func (p *PluginContainer) GetByName(pluginName string) IPlugin
- func (p *PluginContainer) GetDownloader() IDownloadManager
- 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) EmitError(statusCode int, ctx *Context)
- func (r *Router) Errors() IHTTPErrors
- func (r *Router) OnError(statusCode int, handlerFunc HandlerFunc)
- func (r *Router) OnNotFound(handlerFunc HandlerFunc)
- func (r *Router) OnPanic(handlerFunc HandlerFunc)
- func (r *Router) ServeHTTP(res http.ResponseWriter, req *http.Request)
- type RouterDomain
- type RouterType
- type Server
- type Station
- func (s *Station) Close()
- func (s *Station) GetLogger() *Logger
- func (s Station) GetPluginContainer() IPluginContainer
- func (s Station) GetTemplates() *template.Template
- func (s *Station) HasOptimized() bool
- func (s *Station) Listen(fullHostOrPort ...string) error
- func (s *Station) ListenTLS(fullAddress string, certFile, keyFile string) error
- func (s *Station) OptimusPrime()
- func (s *Station) Plugin(plugin IPlugin) error
- func (s *Station) Serve() http.Handler
- func (s *Station) Templates(pathGlob string)
- type StationOptions
- type SyncContextCache
- type SyncMemoryRouter
- 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 application/xml response headers ContentXML = "application/xml" // ContentXMLText is the string of text/xml response headers ContentXMLText = "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('/') // Slash is just a string of "/" Slash = "/" // 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"
)
const (
// LoggerIrisPrefix is the prefix of the logger '[IRIS] '
LoggerIrisPrefix = "[IRIS] "
)
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.
var LoggerOutTerminal = os.Stdout
LoggerOutTerminal os.Stdout , it's the default io.Writer to the Iris' logger
Functions ¶
func Any ¶
func Any(path string, handlersFn ...HandlerFunc)
Any registers a route for ALL of the http methods (Get,Post,Put,Head,Patch,Options,Connect,Delete)
func Close ¶
func Close()
Close is used to close the net.Listener of the standalone http server which has already running via .Listen
func Connect ¶
func Connect(path string, handlersFn ...HandlerFunc)
Connect registers a route for the Connect http method
func CorsMethodMatch ¶
CorsMethodMatch is sets the methodMatch when cors enabled (look OptimusPrime), it's allowing OPTIONS method to all other methods except GET just this
func Delete ¶
func Delete(path string, handlersFn ...HandlerFunc)
Delete registers a route for the Delete http method
func EmitError ¶
EmitError emits an error with it's http status code and the iris Context passed to the function
func Get ¶
func Get(path string, handlersFn ...HandlerFunc)
Get registers a route for the Get http method
func GetParamsLen ¶
GetParamsLen returns the parameters length from a given path
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)
HandleFunc registers a route with a method, path string, and a handler
func Head ¶
func Head(path string, handlersFn ...HandlerFunc)
Head registers a route for the Head http method
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 OnError ¶
func OnError(statusCode int, handlerFunc HandlerFunc)
OnError registers an error to the http custom errors first parameter is the http status code ( int ) second parameter is the actual handler which called when this status code occured, type of HandlerFunc
func OnNotFound ¶
func OnNotFound(handlerFunc HandlerFunc)
OnNotFound sets the handler for http status 404, default is a response with text: 'Not Found' and status: 404
func OnPanic ¶
func OnPanic(handlerFunc HandlerFunc)
OnPanic sets the handler for http status 500, default is a response with text: The server encountered an unexpected condition which prevented it from fulfilling the request. and status: 500
func OptimusPrime ¶
func OptimusPrime()
OptimusPrime , YOU MUST RUN IT ONLY IF YOU DON'T USE iris.Listen or iris.Serve() method
func Options ¶
func Options(path string, handlersFn ...HandlerFunc)
Options registers a route for the Options http method
func ParseAddr ¶
ParseAddr gets a slice of string and returns the address of which the Iris' server can listen
func Patch ¶
func Patch(path string, handlersFn ...HandlerFunc)
Patch registers a route for the Patch http method
func Plugin ¶
Plugin activates the plugins and if succeed then adds it to the activated plugins list
func Post ¶
func Post(path string, handlersFn ...HandlerFunc)
Post registers a route for the Post http method
func Put ¶
func Put(path string, handlersFn ...HandlerFunc)
Put registers a route for the Put http method
func Serve ¶
Serve is used instead of the iris.Listen eg http.ListenAndServe(":80",iris.Serve()) if you don't want to use iris.Listen(":80") ( you can't use iris because its package variable it's golang limitation)
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 Trace ¶
func Trace(path string, handlersFn ...HandlerFunc)
Trace registers a route for the Trace http methodd
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 }
Branch is the node of a tree of the routes, in order to learn how this is working, google 'trie' or watch this lecture: https://www.youtube.com/watch?v=uhAUk63tLRM this method is used by the BSD's kernel also
func (*Branch) AddBranch ¶
func (b *Branch) AddBranch(path string, middleware Middleware)
AddBranch adds a branch to the existing branch or to the tree if no branch has the prefix of
func (*Branch) AddNode ¶
func (b *Branch) AddNode(numParams uint8, path string, fullPath string, middleware Middleware)
AddNode adds a branch as children to other Branch
func (*Branch) GetBranch ¶
func (b *Branch) GetBranch(path string, _params PathParameters) (middleware Middleware, params PathParameters, mustRedirect bool)
GetBranch is used by the Router, it finds and returns the correct branch for a path
func (*Branch) GivePrecedenceTo ¶
GivePrecedenceTo just adds the priority of this branch by an index
type BranchCase ¶
type BranchCase uint8
BranchCase is the type which the type of Branch using in order to determinate what type (parameterized, anything, static...) is the perticular node
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) Done ¶
func (ctx *Context) Done() <-chan struct{}
Done returns a channel that is closed when this Context is canceled or times out.
func (*Context) EmitError ¶
EmitError executes the custom error by the http status code passed to the function
func (*Context) Err ¶
Err indicates why this context was canceled, after the Done channel is closed.
func (*Context) GetFmt ¶
GetFmt returns a value which has this format: func(format string, args ...interface{}) string if doesn't exists returns nil
func (*Context) GetHandlerName ¶
GetHandlerName as requested returns the stack-name of the function which the Middleware is setted from
func (*Context) GetMemoryResponseWriter ¶
func (ctx *Context) GetMemoryResponseWriter() MemoryWriter
GetMemoryResponseWriter returns the MemoryWriter of the Context
func (*Context) GetRequest ¶
GetRequest returns the *http.Request of the Context
func (*Context) GetResponseWriter ¶
func (ctx *Context) GetResponseWriter() IMemoryWriter
GetResponseWriter returns the MemoryWriter of the Context
func (*Context) IsStopped ¶
IsStopped checks and returns true if the current position of the Context is 255, means that the StopExecution has called
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 it sends the default http.NotFound
func (*Context) Panic ¶
func (ctx *Context) Panic()
Panic stops the executions of the context and returns the registed panic handler or if not, the default which is 500 http status to the client
This function is useful when you use the recovery middleware, which is auto-executing the (custom, registed) 500 internal server error.
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) Redirect ¶
Redirect redirect sends a redirect response the client accepts 2 parameters string and an optional int first parameter is the url to redirect second parameter is the http status should send, default is 302 (Temporary redirect), you can set it to 301 (Permant redirect), if that's nessecery
func (*Context) Redo ¶
func (ctx *Context) Redo(res http.ResponseWriter, req *http.Request)
Redo is used inside the MemoryRouter from a cached Context, do whatever Do does but it sets the newresponsewriter and the request before that
func (*Context) RemoteAddr ¶
RemoteAddr is like RequestIP but it checks for proxy servers also, tries to get the real client's request IP
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) RenderXML ¶
RenderXML writes xml which is converted from struct(s) with a http status which they passed to the function via parameters
func (*Context) Reset ¶
func (ctx *Context) Reset(res http.ResponseWriter, req *http.Request)
Reset resets the Context with a given http.ResponseWriter and *http.request the context is ready-to-use after that, just like a new Context I use it for zero rellocation memory
func (*Context) SendStatus ¶
SendStatus sends a http status to the client it receives status code (int) and a message (string)
func (*Context) SetContentType ¶
SetContentType sets the response writer's header key 'Content-Type' to a given value(s)
func (*Context) SetHeader ¶
SetHeader write to the response writer's header to a given key the given value(s)
func (*Context) SetMemoryResponseWriter ¶
func (ctx *Context) SetMemoryResponseWriter(res MemoryWriter)
SetMemoryResponseWriter sets a particular iris.MemoryWriter to the Context
this can be useful on the middlewares which they have access to change the response object itself (the gzip middleware does it)
func (*Context) SetRequest ¶
SetRequest sets a particular *http.Request to the Context
this can be useful on the middlewares which they have access to change the request object itself
func (*Context) SetResponseWriter ¶
func (ctx *Context) SetResponseWriter(res IMemoryWriter)
SetResponseWriter sets the MemoryWriter of the Context
func (*Context) StopExecution ¶
func (ctx *Context) StopExecution()
StopExecution just sets the .pos to 255 in order to not move to the next middlewares(if any)
func (*Context) URLParamInt ¶
URLParamInt returns the get parameter int value from a request , if any
func (*Context) Value ¶
func (ctx *Context) Value(key interface{}) interface{}
Value returns the value associated with key or nil if none.
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
func (*Context) WriteStatus ¶
WriteStatus write/or/and/sends to client, to the response writer a given status code
type ContextCache ¶
type ContextCache struct { MaxItems int // contains filtered or unexported fields }
ContextCache creation done with just &ContextCache{}
func NewContextCache ¶
func NewContextCache() *ContextCache
NewContextCache returns the cache for a router, is used on the MemoryRouter
func (*ContextCache) AddItem ¶
func (mc *ContextCache) AddItem(method, url string, ctx *Context)
AddItem adds an item to the bag/cache, is a goroutine.
func (*ContextCache) DoOnTick ¶
func (mc *ContextCache) DoOnTick()
DoOnTick raised every time the ticker ticks, can be called independed, it's just check for items len and resets the cache
func (*ContextCache) GetItem ¶
func (mc *ContextCache) GetItem(method, url string) *Context
GetItem returns an item from the bag/cache, if not exists it returns just nil.
func (*ContextCache) OnTick ¶
func (mc *ContextCache) OnTick()
OnTick is the implementation of the ITick it makes the ContextCache a ticker's listener
func (*ContextCache) SetMaxItems ¶
func (mc *ContextCache) SetMaxItems(_itemslen int)
SetMaxItems receives int and set max cached items to this number
type DownloadManager ¶
type DownloadManager struct { }
DownloadManager is just a struch which exports the util's downloadZip, directoryExists, unzip methods, used by the plugins via the PluginContainer
func (*DownloadManager) DirectoryExists ¶
func (d *DownloadManager) DirectoryExists(dir string) bool
DirectoryExists returns true if a given local directory exists
func (*DownloadManager) DownloadZip ¶
func (d *DownloadManager) DownloadZip(zipURL string, targetDir string) (string, error)
DownloadZip downlodas a zip to the given local path location
func (*DownloadManager) Install ¶
func (d *DownloadManager) Install(remoteFileZip string, targetDirectory string) (string, error)
Install is just the flow of the: DownloadZip->Unzip->Remove the zip
func (*DownloadManager) Remove ¶
func (d *DownloadManager) Remove(filePath string) error
Remove deletes/removes/rm a file
type ErrorHandler ¶
type ErrorHandler struct {
// contains filtered or unexported fields
}
ErrorHandler is just an object which stores a http status code and a handler
func (ErrorHandler) GetCode ¶
func (e ErrorHandler) GetCode() int
GetCode returns the http status code value
func (ErrorHandler) GetHandler ¶
func (e ErrorHandler) GetHandler() HandlerFunc
GetHandler returns the handler which is type of HandlerFunc
func (*ErrorHandler) SetHandler ¶
func (e *ErrorHandler) SetHandler(h HandlerFunc)
SetHandler sets the handler (type of HandlerFunc) to this particular ErrorHandler
type GardenParty ¶
type GardenParty struct { MiddlewareSupporter // contains filtered or unexported fields }
GardenParty TODO: inline docs
func (*GardenParty) Any ¶
func (p *GardenParty) Any(path string, handlersFn ...HandlerFunc)
Any registers a route for ALL of the http methods (Get,Post,Put,Head,Patch,Options,Connect,Delete)
func (*GardenParty) Connect ¶
func (p *GardenParty) Connect(path string, handlersFn ...HandlerFunc)
Connect registers a route for the Connect http method
func (*GardenParty) Delete ¶
func (p *GardenParty) Delete(path string, handlersFn ...HandlerFunc)
Delete registers a route for the Delete http method
func (*GardenParty) Get ¶
func (p *GardenParty) Get(path string, handlersFn ...HandlerFunc)
Get registers a route for the Get http method
func (*GardenParty) Handle ¶
func (p *GardenParty) Handle(method string, registedPath string, handlers ...Handler)
Handle registers a route to the server's router
func (*GardenParty) HandleAnnotated ¶
func (p *GardenParty) HandleAnnotated(irisHandler Handler) error
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 (*GardenParty) HandleFunc ¶
func (p *GardenParty) HandleFunc(method string, registedPath string, handlersFn ...HandlerFunc)
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 (*GardenParty) Head ¶
func (p *GardenParty) Head(path string, handlersFn ...HandlerFunc)
Head registers a route for the Head http method
func (*GardenParty) Options ¶
func (p *GardenParty) Options(path string, handlersFn ...HandlerFunc)
Options registers a route for the Options http method
func (*GardenParty) Party ¶
func (p *GardenParty) Party(path string) IParty
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 (*GardenParty) Patch ¶
func (p *GardenParty) Patch(path string, handlersFn ...HandlerFunc)
Patch registers a route for the Patch http method
func (*GardenParty) Post ¶
func (p *GardenParty) Post(path string, handlersFn ...HandlerFunc)
Post registers a route for the Post http method
func (*GardenParty) Put ¶
func (p *GardenParty) Put(path string, handlersFn ...HandlerFunc)
Put registers a route for the Put http method
func (*GardenParty) Trace ¶
func (p *GardenParty) Trace(path string, handlersFn ...HandlerFunc)
Trace registers a route for the Trace http method
func (*GardenParty) Use ¶
func (p *GardenParty) Use(handlers ...Handler)
Use pass the middleware here it overrides the MiddlewareSupporter's Use only in order to be able to call forceOptimusPrime
func (*GardenParty) Ws ¶
func (p *GardenParty) Ws(path string, handler Handler)
Ws registers a websocket route
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
Example of usage: iris.OnError(405, func (ctx *iris.Context){ c.SendStatus(405,"Method not allowed!!!")}) and inside the handler which you have access to the current Context: ctx.EmitError(405) that is the circle, the httpErrors variable stays at the Station(via it's Router), sets from there and emits from a context, but you can also emit directly from iris.Errors().Emit(405,ctx) if that's necessary
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
GetByCode returns the error handler by it's http status code
func (*HTTPErrors) On ¶
func (he *HTTPErrors) On(httpStatus int, handler HandlerFunc)
On Registers a handler for a specific http error status
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
ErrorHandlerFunc 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 }
IBranch is the interface which the type Branch must implement
type IContext ¶
type IContext interface { context.Context Reset(http.ResponseWriter, *http.Request) Do() Redo(http.ResponseWriter, *http.Request) Next() GetResponseWriter() IMemoryWriter GetRequest() *http.Request GetMemoryResponseWriter() MemoryWriter SetMemoryResponseWriter(MemoryWriter) 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) // Errors NotFound() Panic() EmitError(statusCode int) StopExecution() // Redirect(path string, statusHeader ...int) error SendStatus(statusCode int, message string) RequestIP() string Close() End() IsStopped() bool Clone() *Context ///todo IContext again RenderFile(file string, pageContext interface{}) error Render(pageContext interface{}) error // // WriteStatus writes http status code to the header WriteStatus(statusCode int) // SetContentType sets the "Content-Type" header, receives the values SetContentType(s []string) // SetHeader sets the response headers first parameter is the key, second is the values SetHeader(k string, s []string) // 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 ReadJSON(jsonObject interface{}) error WriteJSON(httpStatus int, jsonObjectOrArray interface{}) error JSON(jsonObjectOrArray interface{}) error WriteXML(httpStatus int, xmlB []byte) error XML(xmlB []byte) error RenderXML(hhttpStatus int, xmlStructs ...interface{}) error ReadXML(xmlObject interface{}) error GetHandlerName() string }
IContext is the domain-driven interface for the iris Context
type IContextCache ¶
type IContextCache interface { OnTick() AddItem(method, url string, ctx *Context) // This is the faster method, just set&return just a *Context, I tried to return only params and middleware but it's add 10.000 nanoseconds, also +2k bytes of memory . So let's keep it as I did thee first time, I don't know what do do to make it's performance even better... It doesn't go much best, can't use channels because the performance will be get very low, locks are better for this purpose. GetItem(method, url string) *Context SetMaxItems(maxItems int) }
IContextCache is the interface of the ContextCache & SyncContextCache
type IDictionary ¶
IDictionary is the interface which PathParameters using it's just a Get(key), Set(key,value) pair store
type IDownloadManager ¶
type IDownloadManager interface { DirectoryExists(dir string) bool DownloadZip(zipURL string, targetDir string) (string, error) Unzip(archive string, target string) (string, error) Remove(filePath string) error // install is just the flow of: downloadZip -> unzip -> removeFile(zippedFile) // accepts 2 parameters // // first parameter is the remote url file zip // second parameter is the target directory // returns a string(installedDirectory) and an error // // (string) installedDirectory is the directory which the zip file had, this is the real installation path, you don't need to know what it's because these things maybe change to the future let's keep it to return the correct path. // the installedDirectory is not empty when the installation is succed, the targetDirectory is not already exists and no error happens // the installedDirectory is empty when the installation is already done by previous time or an error happens Install(remoteFileZip string, targetDirectory string) (string, error) }
IDownloadManager is the interface which the DownloadManager should implements
type IErrorHandler ¶
type IErrorHandler interface { GetCode() int GetHandler() HandlerFunc SetHandler(h HandlerFunc) }
IErrorHandler is the interface which an http error handler should implement
type IHTTPErrors ¶
type IHTTPErrors interface { GetByCode(httpStatus int) IErrorHandler On(httpStatus int, handler HandlerFunc) Emit(errCode int, ctx *Context) }
IHTTPErrors is the interface which the HTTPErrors using
func Errors ¶
func Errors() IHTTPErrors
Errors returns the object which is resposible for the error(s) handler(s)
type IMemoryRouter ¶
type IMemoryRouter interface { IRouter ServeWithPath(string, http.ResponseWriter, *http.Request) // contains filtered or unexported methods }
IMemoryRouter is the in-memory cached version of the Router
type IMemoryWriter ¶
type IMemoryWriter interface { http.ResponseWriter http.Hijacker http.CloseNotifier Reset(underlineRes http.ResponseWriter) WriteString(s string) (int, error) Size() int Status() int // IsWritten() bool ForceHeader() }
IMemoryWriter is the interface which the MemoryWriter should implement, implements the http.ResponseWriter
type IMiddlewareSupporter ¶
type IMiddlewareSupporter interface { Use(handlers ...Handler) UseFunc(handlersFn ...HandlerFunc) }
IMiddlewareSupporter is an interface which all routers must implement
type IParty ¶
type IParty interface { IMiddlewareSupporter Handle(method string, registedPath string, handlers ...Handler) HandleFunc(method string, registedPath string, handlersFn ...HandlerFunc) HandleAnnotated(irisHandler Handler) error Get(path string, handlersFn ...HandlerFunc) Post(path string, handlersFn ...HandlerFunc) Put(path string, handlersFn ...HandlerFunc) Delete(path string, handlersFn ...HandlerFunc) Connect(path string, handlersFn ...HandlerFunc) Head(path string, handlersFn ...HandlerFunc) Options(path string, handlersFn ...HandlerFunc) Patch(path string, handlersFn ...HandlerFunc) Trace(path string, handlersFn ...HandlerFunc) Any(path string, handlersFn ...HandlerFunc) Ws(path string, handler Handler) Party(path string) IParty // Each party can have a party too // contains filtered or unexported methods }
IParty is the interface which implements the whole Party of routes
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 }
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(route IRoute) DoPostHandle(route IRoute) DoPreListen(station *Station) DoPostListen(station *Station) DoPreClose(station *Station) DoPreDownload(pluginTryToDownload IPlugin, downloadURL string) GetAll() []IPlugin // GetDownloader is the only one module that is used and fire listeners at the same time in this file GetDownloader() IDownloadManager }
IPluginContainer is the interface which the PluginContainer should implements
type IPluginPostHandle ¶
type IPluginPostHandle interface { // PostHandle it's being called every time AFTER a Route successfully registed to the Router // // parameter is the Route PostHandle(IRoute) }
IPluginPostHandle implements the PostHandle(IRoute) method
type IPluginPostListen ¶
type IPluginPostListen interface { // PostListen it's being called only one time, AFTER the Server is started (if .Listen called) // parameter is the station PostListen(*Station) }
IPluginPostListen implements the PostListen(*Station) method
type IPluginPreClose ¶
type IPluginPreClose interface { // 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) }
IPluginPreClose implements the PreClose(*Station) method
type IPluginPreDownload ¶
type IPluginPreDownload interface { // PreDownload it's being called every time a plugin tries to download something // // first parameter is the plugin // second parameter is the download url // must return a boolean, if false then the plugin is not permmited to download this file PreDownload(plugin IPlugin, downloadURL string) // bool }
IPluginPreDownload It's for the future, not being used, I need to create and return an ActivatedPlugin type which will have it's methods, and pass it on .Activate but now we return the whole pluginContainer, which I can't determinate which plugin tries to download something, so we will leave it here for the future.
type IPluginPreHandle ¶
type IPluginPreHandle interface { // PreHandle it's being called every time BEFORE a Route is registed to the Router // // parameter is the Route PreHandle(IRoute) }
IPluginPreHandle implements the PreHandle(IRoute) method
type IPluginPreListen ¶
type IPluginPreListen interface { // 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 // parameter is the station PreListen(*Station) }
IPluginPreListen implements the PreListen(*Station) method
type IRoute ¶
type IRoute interface { GetMethod() string GetDomain() string GetPath() string GetPathPrefix() string ProcessPath() GetMiddleware() Middleware SetMiddleware(m Middleware) }
IRoute is the interface which the Route should implements it useful to have it as an interface because this interface is passed to the plugins
type IRouter ¶
type IRouter interface { IParty // Errors Errors() IHTTPErrors OnError(statusCode int, handlerFunc HandlerFunc) // EmitError emits an error with it's http status code and the iris Context passed to the function EmitError(statusCode int, ctx *Context) // OnNotFound sets the handler for http status 404, // default is a response with text: 'Not Found' and status: 404 OnNotFound(handlerFunc HandlerFunc) // OnPanic sets the handler for http status 500, // default is a response with text: The server encountered an unexpected condition which prevented it from fulfilling the request. and status: 500 OnPanic(handlerFunc HandlerFunc) // ServeHTTP(http.ResponseWriter, *http.Request) // contains filtered or unexported methods }
IRouter is the interface of which any Iris router must implement
type IStation ¶
type IStation interface { IRouter Serve() http.Handler Plugin(IPlugin) error GetPluginContainer() IPluginContainer GetTemplates() *template.Template //yes we need that again if no .Listen called and you use other server, you have to call .Build() before OptimusPrime() HasOptimized() bool GetLogger() *Logger }
IStation is the interface which the Station should implements
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
func (*MemoryRouter) ServeWithPath ¶
func (r *MemoryRouter) ServeWithPath(path string, res http.ResponseWriter, req *http.Request)
ServeWithPath serves a request The only use of this is to no dublicate this particular code inside the other 2 memory routers.
type MemoryRouterDomain ¶
type MemoryRouterDomain struct {
*MemoryRouter
}
MemoryRouterDomain is the MemoryRouter which is responsible and selected if and only if routes has at least one domain route
func NewMemoryRouterDomain ¶
func NewMemoryRouterDomain(underlineRouter *MemoryRouter) *MemoryRouterDomain
NewMemoryRouterDomain creates a MemoryRouterDomain and returns it
func (*MemoryRouterDomain) ServeHTTP ¶
func (r *MemoryRouterDomain) ServeHTTP(res http.ResponseWriter, req *http.Request)
type MemoryWriter ¶
type MemoryWriter struct { http.ResponseWriter // contains filtered or unexported fields }
MemoryWriter is used inside Context instead of the http.ResponseWriter, used to have the maximum access and modification via middlewares to the ResponseWriter also offers faster produce of each request's response writer
func (*MemoryWriter) CloseNotify ¶
func (m *MemoryWriter) CloseNotify() <-chan bool
CloseNotify look inside net/http package
func (*MemoryWriter) Flush ¶
func (m *MemoryWriter) Flush()
Flush flushes the contents of the writer
func (*MemoryWriter) ForceHeader ¶
func (m *MemoryWriter) ForceHeader()
ForceHeader forces to write the header and reset's the size of the ResponseWriter
func (*MemoryWriter) Hijack ¶
func (m *MemoryWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack look inside net/http package
func (*MemoryWriter) IsWritten ¶
func (m *MemoryWriter) IsWritten() bool
IsWritten returns true if we already wrote to the MemoryWriter
func (*MemoryWriter) Reset ¶
func (m *MemoryWriter) Reset(underlineRes http.ResponseWriter)
Reset takes an underline http.ResponseWriter and resets the particular MemoryWriter with this underline http.ResponseWriter
func (*MemoryWriter) Status ¶
func (m *MemoryWriter) Status() int
Status returns the http status code
func (*MemoryWriter) WriteHeader ¶
func (m *MemoryWriter) WriteHeader(statusCode int)
WriteHeader writes an http status code
func (*MemoryWriter) WriteString ¶
func (m *MemoryWriter) WriteString(s string) (size int, err error)
WriteString using io.WriteString to write a string
type Middleware ¶
type Middleware []Handler
Middleware is just a slice of Handler []func(c *Context)
func JoinMiddleware ¶
func JoinMiddleware(middleware1 Middleware, middleware2 Middleware) Middleware
JoinMiddleware uses to create a copy of all middleware and return them in order to use inside the node
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) 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(route IRoute)
DoPostHandle raise all plugins which has the DoPostHandle method
func (*PluginContainer) DoPostListen ¶
func (p *PluginContainer) DoPostListen(station *Station)
DoPostListen raise all plugins which has the DoPostListen method
func (*PluginContainer) DoPreClose ¶
func (p *PluginContainer) DoPreClose(station *Station)
DoPreClose raise all plugins which has the DoPreClose method
func (*PluginContainer) DoPreDownload ¶
func (p *PluginContainer) DoPreDownload(pluginTryToDownload IPlugin, downloadURL string)
DoPreDownload raise all plugins which has the DoPreDownload method
func (*PluginContainer) DoPreHandle ¶
func (p *PluginContainer) DoPreHandle(route IRoute)
DoPreHandle raise all plugins which has the PreHandle method
func (*PluginContainer) DoPreListen ¶
func (p *PluginContainer) DoPreListen(station *Station)
DoPreListen raise all plugins which has the DoPreListen method
func (*PluginContainer) GetAll ¶
func (p *PluginContainer) GetAll() []IPlugin
GetAll returns all activated plugins
func (*PluginContainer) GetByName ¶
func (p *PluginContainer) GetByName(pluginName string) IPlugin
GetByName returns a plugin instance by it's name
func (*PluginContainer) GetDownloader ¶
func (p *PluginContainer) GetDownloader() IDownloadManager
GetDownloader returns the download manager
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(method string, registedPath string, middleware Middleware) *Route
NewRoute creates, from a path string, and a slice of HandlerFunc
func (Route) GetDomain ¶
GetDomain returns the registed domain which this route is ( if none, is "" which is means "localhost"/127.0.0.1)
func (Route) GetMiddleware ¶
func (r Route) GetMiddleware() Middleware
GetMiddleware returns the chain of the []HandlerFunc registed to this Route
func (Route) GetPathPrefix ¶
GetPathPrefix returns the path prefix, this is the static part before any parameter or *any
func (*Route) ProcessPath ¶
func (r *Route) ProcessPath()
ProcessPath modifies the path in order to set the path prefix of this Route
func (Route) SetMiddleware ¶
func (r Route) SetMiddleware(m Middleware)
SetMiddleware sets the middleware(s)
type Router ¶
type Router struct { IParty // 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) EmitError ¶
EmitError emits an error with it's http status code and the iris Context passed to the function
func (*Router) Errors ¶
func (r *Router) Errors() IHTTPErrors
Errors returns the object which is resposible for the error(s) handler(s)
func (*Router) OnError ¶
func (r *Router) OnError(statusCode int, handlerFunc HandlerFunc)
OnError registers a handler ( type of HandlerFunc) for a specific http error status
func (*Router) OnNotFound ¶
func (r *Router) OnNotFound(handlerFunc HandlerFunc)
OnNotFound sets the handler for http status 404, default is a response with text: 'Not Found' and status: 404
func (*Router) OnPanic ¶
func (r *Router) OnPanic(handlerFunc HandlerFunc)
OnPanic sets the handler for http status 500, default is a response with text: The server encountered an unexpected condition which prevented it from fulfilling the request. and status: 500
type RouterDomain ¶
type RouterDomain struct {
*Router
}
RouterDomain same as Router but it's override the ServeHTTP and proccessPath.
func NewRouterDomain ¶
func NewRouterDomain(underlineRouter *Router) *RouterDomain
NewRouterDomain creates a RouterDomain from an underline (normal) Router and returns it
func (*RouterDomain) ServeHTTP ¶
func (r *RouterDomain) ServeHTTP(res http.ResponseWriter, req *http.Request)
type RouterType ¶
type RouterType uint8
RouterType is just the type which the Router uses to indentify what type is (Normal,Memory,MemorySync,Domain,DomainMemory )
const ( // Normal is the Router Normal RouterType = iota // Memory is the MemoryRouter , used when cache is enabled Memory // this is the MemoryRouter // MemorySync is the SyncMemoryRouter which is used when cache is enabled and cores > 1 MemorySync // this is the SyncMemoryRouter // Domain is the RouterDomain, used when at least one route has domains Domain // DomainMemory is the MemoryDomainRouter, used when Domain is used and cache is enabled DomainMemory // this is the MemoryDomainRouter )
type Server ¶
type Server struct { IsRunning bool ListeningAddr string // IsSecure true if ListenTLS (https/http2) IsSecure bool CertFile, KeyFile string // 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 ¶
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
GetPluginContainer returns the pluginContainer
func (Station) GetTemplates ¶
GetTemplates returns the *template.Template registed to this station, if any
func (*Station) HasOptimized ¶
HasOptimized returns if the station has optimized ( OptimusPrime run once)
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
func (*Station) OptimusPrime ¶
func (s *Station) OptimusPrime()
OptimusPrime make the best last optimizations to make iris the faster framework out there This function is called automatically on .Listen, but if you don't use .Listen or .Serve, then YOU MUST CALL .OptimusPrime before run a server
func (*Station) Plugin ¶
Plugin activates the plugins and if succeed then adds it to the activated plugins list
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 SyncContextCache ¶
type SyncContextCache struct { *ContextCache // contains filtered or unexported fields }
SyncContextCache is the cache version of routine-thread-safe ContextCache
func NewSyncContextCache ¶
func NewSyncContextCache(underlineCache *ContextCache) *SyncContextCache
NewSyncContextCache returns the cache for a router, it's based on the one-thread ContextCache
func (*SyncContextCache) AddItem ¶
func (mc *SyncContextCache) AddItem(method, url string, ctx *Context)
AddItem adds an item to the bag/cache, is a goroutine.
func (*SyncContextCache) GetItem ¶
func (mc *SyncContextCache) GetItem(method, url string) *Context
GetItem returns an item from the bag/cache, if not exists it returns just nil.
func (*SyncContextCache) OnTick ¶
func (mc *SyncContextCache) OnTick()
OnTick is the implementation of the ITick it makes the ContextCache a ticker's listener
type SyncMemoryRouter ¶
type SyncMemoryRouter struct { IMemoryRouter // contains filtered or unexported fields }
SyncMemoryRouter is the Router which is routine-thread-safe version of MemoryRouter, used only and only if running cores are > 1
func NewSyncRouter ¶
func NewSyncRouter(underlineRouter IMemoryRouter) *SyncMemoryRouter
NewSyncRouter creates and returns a new SyncRouter object, from an underline IMemoryRouter
func (*SyncMemoryRouter) ServeHTTP ¶
func (r *SyncMemoryRouter) ServeHTTP(res http.ResponseWriter, req *http.Request)
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
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
middleware
|
|
cors
Cors credits goes to @keuller
|
Cors credits goes to @keuller |
plugin
|
|
Package websocket implements a client and server for the WebSocket protocol as specified in RFC 6455.
|
Package websocket implements a client and server for the WebSocket protocol as specified in RFC 6455. |