Documentation ¶
Index ¶
- Variables
- func HostURL(path string) func(*VascoClient)
- func Logger(logger *log.Entry) func(*VascoClient)
- func MyIP(ip string) func(*VascoClient)
- func Refresh(t time.Duration) func(*VascoClient)
- func VascoAddress(addr string) func(*VascoClient)
- type RequestCounter
- type Status
- type VascoClient
- func (vc *VascoClient) CL(handler http.HandlerFunc) http.HandlerFunc
- func (vc *VascoClient) CountQuery()
- func (vc *VascoClient) CountRequests(handler http.HandlerFunc) http.HandlerFunc
- func (vc *VascoClient) CountServerError()
- func (vc *VascoClient) CountUserError()
- func (vc *VascoClient) GetPort() string
- func (vc *VascoClient) GetProxyUrl(path string) url.URL
- func (vc *VascoClient) GetStatus() Status
- func (vc *VascoClient) LogRequests(handler http.HandlerFunc) http.HandlerFunc
- func (vc *VascoClient) MaxClients(handler http.HandlerFunc, n int) http.HandlerFunc
- func (vc *VascoClient) MyIP() (string, error)
- func (vc *VascoClient) Refresh() error
- func (vc *VascoClient) RefreshAndSetTimer()
- func (vc *VascoClient) Register(name, port, pattern, status string) error
- func (vc *VascoClient) Unregister() error
Constants ¶
This section is empty.
Variables ¶
View Source
var SourceDeployTag string = "Not set"
View Source
var SourceRevision string = "Not set"
These will be set by the linker when built using the standard tools
Functions ¶
func HostURL ¶
func HostURL(path string) func(*VascoClient)
func MyIP ¶
func MyIP(ip string) func(*VascoClient)
func Refresh ¶
func Refresh(t time.Duration) func(*VascoClient)
func VascoAddress ¶
func VascoAddress(addr string) func(*VascoClient)
Types ¶
type RequestCounter ¶
type RequestCounter struct {
// contains filtered or unexported fields
}
func NewRequestCounter ¶
func NewRequestCounter(dur time.Duration) *RequestCounter
func (*RequestCounter) Count ¶
func (rc *RequestCounter) Count() int
func (*RequestCounter) N ¶
func (rc *RequestCounter) N() int
type Status ¶
type Status struct { StartTime time.Time `json:"starttime"` Uptime string `json:"uptime"` Revision string `json:"revision"` DeployTag string `json:"deploytag"` DeployType string `json:"configtype"` ConfigVersion string `json:"configversion"` IP string `json:"ip"` PID int `json:"pid"` Requests int `json:"requests"` UserErrors int `json:"usererrors"` ServerErrors int `json:"servererrors"` RequestsLastHour int `json:"requestslasthour"` RequestsLast5Min int `json:"requestslast5min"` // contains filtered or unexported fields }
func (*Status) FillStatus ¶
func (st *Status) FillStatus()
type VascoClient ¶
func New ¶
func New(options ...func(*VascoClient)) *VascoClient
New creates a new client and supports an arbitrary collection of initialization option functions (see above)
func (*VascoClient) CL ¶
func (vc *VascoClient) CL(handler http.HandlerFunc) http.HandlerFunc
CL is middleware that composes LogRequests and CountRequests
func (*VascoClient) CountQuery ¶
func (vc *VascoClient) CountQuery()
func (*VascoClient) CountRequests ¶
func (vc *VascoClient) CountRequests(handler http.HandlerFunc) http.HandlerFunc
CountRequests is middleware for standard handler functions
func (*VascoClient) CountServerError ¶
func (vc *VascoClient) CountServerError()
func (*VascoClient) CountUserError ¶
func (vc *VascoClient) CountUserError()
func (*VascoClient) GetPort ¶
func (vc *VascoClient) GetPort() string
fetch a port number as a string from vasco's port service
func (*VascoClient) GetProxyUrl ¶
func (vc *VascoClient) GetProxyUrl(path string) url.URL
Return a URL ready for a Vasco proxy query (instead of going through the external load balancer, apps behind Vasco can talk to its proxy port directly).
func (*VascoClient) GetStatus ¶
func (vc *VascoClient) GetStatus() Status
func (*VascoClient) LogRequests ¶
func (vc *VascoClient) LogRequests(handler http.HandlerFunc) http.HandlerFunc
LogRequests is middleware
func (*VascoClient) MaxClients ¶
func (vc *VascoClient) MaxClients(handler http.HandlerFunc, n int) http.HandlerFunc
MaxClients is middleware that allows limiting the number of simultaneous requests to a given endpoint.
func (*VascoClient) MyIP ¶
func (vc *VascoClient) MyIP() (string, error)
func (*VascoClient) Refresh ¶
func (vc *VascoClient) Refresh() error
func (*VascoClient) RefreshAndSetTimer ¶
func (vc *VascoClient) RefreshAndSetTimer()
func (*VascoClient) Register ¶
func (vc *VascoClient) Register(name, port, pattern, status string) error
func (*VascoClient) Unregister ¶
func (vc *VascoClient) Unregister() error
Click to show internal directories.
Click to hide internal directories.