Documentation ¶
Index ¶
- Variables
- func CheckX509()
- func ErrPropagate(api string)
- func ErrPropagate2Channel(api string, ch chan interface{})
- func Fetch(rurl, args string, ch chan<- ResponseType)
- func FindInList(a string, arr []string) bool
- func GoDeferFunc(api string, f func())
- func Hash(data []byte) (string, int64)
- func HostIP() []string
- func HttpClient() *http.Client
- func InList(a string, list []string) bool
- func List2Set(arr []string) []string
- func ListFiles(dir string) []string
- func LogSettings(level string, format string)
- func MapKeys(rec map[string]interface{}) []string
- func ParseTmpl(tdir, tmpl string, data interface{}) string
- func Response(rurl string, data []byte) []byte
- func Stack() string
- func UserDN(r *http.Request) string
- type Record
- type ResponseType
- type UrlRequest
Constants ¶
This section is empty.
Variables ¶
var MEMORY bool
MEMORY variable controls memory printout
var PatternNumber = regexp.MustCompile("^[0-9]")
var PatternUrl = regexp.MustCompile("(https|http)://[-A-Za-z0-9_+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]")
var STATICDIR string
STATICDIR defines location of all static files
var VERBOSE int
VERBOSE variable controls verbosity level of client's utilities
Functions ¶
func ErrPropagate ¶
func ErrPropagate(api string)
ErrPropagate error helper function which can be used in defer ErrPropagate()
func ErrPropagate2Channel ¶
func ErrPropagate2Channel(api string, ch chan interface{})
ErrPropagate2Channel error helper function which can be used in goroutines as ch := make(chan interface{})
go func() { defer ErrPropagate2Channel(api, ch) someFunction() }()
func Fetch ¶
func Fetch(rurl, args string, ch chan<- ResponseType)
Fetch data for provided URL and redirect results to given channel
func FindInList ¶
FindInList helper function to find item in a list
func GoDeferFunc ¶
func GoDeferFunc(api string, f func())
GoDeferFunc helper function to run any given function in defered go routine
func LogSettings ¶
LogSettings setups settings for underlying logrus logger
Types ¶
type Record ¶
type Record map[string]interface{}
Record data-type defines ReqMgr2 data record
func Convert2Record ¶
func Convert2Record(item interface{}) Record
Convert2Record converts given interface to Record data type
type ResponseType ¶
type ResponseType struct { Url string // response url Data []byte // response data, i.e. what we got with Body of the response Error error // http error, a non-2xx return code is not an error Status string // http status string StatusCode int // http status code }
ResponseType structure is what we expect to get for our URL call. It contains a request URL, the data chunk and possible error from remote
func FetchResponse ¶
func FetchResponse(rurl, args string) ResponseType
FetchResponse fetches data for provided URL, args is a json dump of arguments
func (*ResponseType) String ¶
func (r *ResponseType) String() string
type UrlRequest ¶
type UrlRequest struct {
// contains filtered or unexported fields
}
UrlRequest structure holds details about url request's attributes