Documentation ¶
Index ¶
- func ExtractIP(r *http.Request) string
- func GetIPHeader(r *http.Request) string
- func NewTransport() http.RoundTripper
- func ParseDateParam(s string) (*time.Time, error)
- func ParseURL(str string) (*url.URL, error)
- func StartOfMonth(now time.Time, next int) time.Time
- func TakeJSONInput(c echo.Context, input interface{}) error
- func ValidateIPInWhiteList(ips, ip string) (bool, error)
- func ValidateIPsCIDR(ip string) error
- type IPExtractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTransport ¶
func NewTransport() http.RoundTripper
NewTransport creates new roundtriper with same MaxIdleConnsPerHost ready to be used for access to only one host
func ParseDateParam ¶
ParseDateParam parse query param or returns echo error
func StartOfMonth ¶
StartOfMonth returns the time when month starts
func TakeJSONInput ¶
func TakeJSONInput(c echo.Context, input interface{}) error
TakeJSONInput extracts request body to 'input' as json object, checks for correct mime type
func ValidateIPInWhiteList ¶
ValidateIPInWhiteList check if IPs is in valid range of white lists
func ValidateIPsCIDR ¶
ValidateIPsCIDR check if IPs are valid comma separated CIDR format
Types ¶
type IPExtractor ¶
IPExtractor extracts IP from request
var DefaultIPExtractor IPExtractor = &firstForwardFor{}
DefaultIPExtractor default implementation
func NewIPExtractor ¶
func NewIPExtractor(ipType string) (IPExtractor, error)
NewIPExtractor creates new extractor based on type
Click to show internal directories.
Click to hide internal directories.