Documentation ¶
Index ¶
- Variables
- 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) GetRefreshTime() int
- func (vc *VascoClient) GetStatus() Status
- func (vc *VascoClient) LogRequests(handler http.HandlerFunc) http.HandlerFunc
- 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 ¶
This section is empty.
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 NewWithLogger ¶ added in v1.1.0
func NewWithLogger(logger *log.Entry) VascoClient
New creates a new client and lets you give it a logger to use. This lets you decorate the logger with some predefined values.
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) GetRefreshTime ¶
func (vc *VascoClient) GetRefreshTime() int
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) 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.