Documentation ¶
Index ¶
- Variables
- func CheckX509()
- func ErrPropagate(api string)
- func ErrPropagate2Channel(api string, ch chan interface{})
- func Fetch(rurl string, args []byte, 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 MapKeys(rec map[string]interface{}) []string
- func ParseTmpl(tmpl string, data interface{}) string
- func Response(rurl string, data []byte) []byte
- func SourceLine() string
- func Stack() string
- func UsedCPU() (float64, error)
- func UsedRAM() (float64, error)
- func UserDN(r *http.Request) string
- type ResponseType
- type UrlRequest
Constants ¶
This section is empty.
Variables ¶
var Auth bool
Auth variable neglects auth layer
var PatternUrl = regexp.MustCompile("(https|http)://[-A-Za-z0-9_+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]")
PatternUrl represents http pattern
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 string, args []byte, 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
Types ¶
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 string, args []byte) ResponseType
FetchResponse fetches data for provided URL, args is a json dump of arguments
func (*ResponseType) String ¶
func (r *ResponseType) String() string
String provides string representation for ResponseType
type UrlRequest ¶
type UrlRequest struct {
// contains filtered or unexported fields
}
UrlRequest structure holds details about url request's attributes