Documentation ¶
Index ¶
- Variables
- func DecodeCheckJSONBody(w http.ResponseWriter, r *http.Request, v interface{}) (err error)
- func ExecuteGet(url string, rc *RequestContext)
- func ExecuteRequest(req *http.Request, rc *RequestContext)
- func HttpError(w http.ResponseWriter, code int, msg ...string)
- func IsServerClosedIdle(err error) bool
- func ListenAndServe(addr string, routes []*Route, tlsConfig *tls.Config)
- func MarshalIndent(v interface{}) []byte
- func Match2Map(m []int, s string, pat *regexp.Regexp) map[string]string
- func NewEvent() *sync.WaitGroup
- func NewServerTLSConfig(fname string) *tls.Config
- func NewTLSConfig(tlsFname string) *tls.Config
- func PrintReport(stats *StatsType, stressTimes StressTimes, aggregationCount int)
- func RaiseHttpError(code int, msg ...string)
- func Serve(addr string, appRoutes Routes, serveData *ServeData, tlsConfig *tls.Config)
- func ServeDummyHTTP(targetUrl string, route *Route, serverTLSConfigFname string)
- func ServeJSON(w http.ResponseWriter, code int, jsonBytes []byte)
- type CheckData
- type Duration
- type HandlerFunc
- type HttpException
- type JobContext
- type Match
- type RequestContext
- type RequestContextOptions
- type Route
- type RouteFunc
- type RouteHelp
- type Routes
- type ServeData
- type ServerHandler
- type ServerTLSConfig
- type StatElement
- type StatList
- type StatsType
- type Statuses
- type StrDict
- type StressTimes
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var CheckError = base.CheckError
Functions ¶
func DecodeCheckJSONBody ¶
func DecodeCheckJSONBody(w http.ResponseWriter, r *http.Request, v interface{}) (err error)
func ExecuteGet ¶
func ExecuteGet(url string, rc *RequestContext)
func ExecuteRequest ¶
func ExecuteRequest(req *http.Request, rc *RequestContext)
func IsServerClosedIdle ¶
func MarshalIndent ¶
func MarshalIndent(v interface{}) []byte
func NewEvent ¶
.Done() and .Wait() may be implemented via channels like so: jobsEnded := make(chan struct{}) close(jobsEnded) // = .Done() <-jobsEnded // = .Wait()
But channels may be select-ed and wg's - not. So, if you do not use select then WaitGroup is just a sufficient match
func NewServerTLSConfig ¶
func NewTLSConfig ¶
func PrintReport ¶
func PrintReport(stats *StatsType, stressTimes StressTimes, aggregationCount int)
func RaiseHttpError ¶
func ServeDummyHTTP ¶
Types ¶
type CheckData ¶
type CheckData struct { Version string `json:"version"` Start time.Time `json:"start"` UptimeSeconds float64 `json:"uptime_seconds"` }
func MakeCheckData ¶
type Duration ¶
func (Duration) MarshalText ¶
type HandlerFunc ¶
type HandlerFunc func(http.ResponseWriter, *http.Request, Match)
type HttpException ¶
type JobContext ¶
type JobContext struct { StartJob func(jobFunc func()) Wait func() }
func NewJobContext ¶
func NewJobContext() *JobContext
type Match ¶
type Match struct {
// contains filtered or unexported fields
}
func (Match) GetArgumentsMap ¶
type RequestContext ¶
type RequestContext struct { Client *http.Client Stats *StatsType IncrStat func(msg string, dur float64) WaitStatsReady func() }
func NewRequestContext ¶
func NewRequestContext() *RequestContext
func NewRequestContextEx ¶
func NewRequestContextEx(rco *RequestContextOptions) *RequestContext
type RequestContextOptions ¶
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func NewRoute ¶
func NewRoute(pattern string, handler HandlerFunc) *Route
type RouteFunc ¶
type RouteFunc func(pattern string, handler HandlerFunc, optHelp ...string) *Route
func GenerateMakeRoute ¶
type ServeData ¶
type ServeData struct {
// contains filtered or unexported fields
}
func NewServeData ¶
type ServerHandler ¶
type ServerHandler struct {
// contains filtered or unexported fields
}
func (*ServerHandler) ServeHTTP ¶
func (handler *ServerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ServerTLSConfig ¶
type StatElement ¶
type StatList ¶
type StatList []StatElement
type StressTimes ¶
in seconds
func MakeStress ¶
func MakeStress(jobFunc func(), rps float64, duration float64, requestCnt int) StressTimes
Click to show internal directories.
Click to hide internal directories.