{"modulePath":"github.com/cnelson/gorouter","version":"v0.0.0-20160408230424-8ab5ff9217f2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package common\n\n## Constants\n\n```go\nconst RefreshInterval time.Duration = time.Second * 1\n```\n\n## Functions\n\n```go\nfunc GenerateUUID() (string, error)\n```\n\n```go\nfunc UnixToTime(unixTime string) (time.Time, error)\n```\n\n## Types\n\n```go\ntype Duration time.Duration\n```\n\n```go\nfunc (d Duration) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (d *Duration) UnmarshalJSON(b []byte) error\n```\n\n```go\ntype GenericVarz struct {\n\t// These fields are from individual components\n\tType        string   `json:\"type\"`\n\tIndex       uint     `json:\"index\"`\n\tHost        string   `json:\"host\"`\n\tCredentials []string `json:\"credentials\"`\n\n\t// These fields are automatically generated\n\tUUID      string `json:\"uuid\"`\n\tStartTime Time   `json:\"start\"`\n\n\t// Static common metrics\n\tNumCores int `json:\"num_cores\"`\n\n\t// Dynamic common metrics\n\tMemStat int64   `json:\"mem\"`\n\tCpu     float64 `json:\"cpu\"`\n\n\tUptime    Duration    `json:\"uptime\"`\n\tLogCounts *LogCounter `json:\"log_counts\"`\n}\n```\n\n```go\ntype Healthz struct {\n}\n```\n\n```go\nfunc (v *Healthz) Value() string\n```\n\n```go\ntype LogCounter struct {\n\tsync.Mutex\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewLogCounter() *LogCounter\n```\n\n```go\nfunc (lc *LogCounter) GetCount(key string) int\n```\n\n```go\nfunc (lc *LogCounter) Log(log lager.LogFormat)\n```\n\n```go\nfunc (lc *LogCounter) MarshalJSON() ([]byte, error)\n```\n\n```go\ntype ProcessStatus struct {\n\tsync.RWMutex\n\n\tCpuUsage float64\n\tMemRss   int64\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewProcessStatus() *ProcessStatus\n```\n\n```go\nfunc (p *ProcessStatus) StopUpdate()\n```\n\n```go\nfunc (p *ProcessStatus) Update()\n```\n\n```go\ntype RouterStart struct {\n\tId                               string   `json:\"id\"`\n\tHosts                            []string `json:\"hosts\"`\n\tMinimumRegisterIntervalInSeconds int      `json:\"minimumRegisterIntervalInSeconds\"`\n\tPruneThresholdInSeconds          int      `json:\"pruneThresholdInSeconds\"`\n}\n```\n\n```go\ntype Time time.Time\n```\n\n```go\nfunc (t Time) Elapsed() Duration\n```\n\n```go\nfunc (t Time) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (t *Time) UnmarshalJSON(b []byte) error\n```\n\n```go\ntype Varz struct {\n\tsync.Mutex\n\tGenericVarz\n\tUniqueVarz interface{} // Every component's unique metrics\n}\n```\n\n```go\nfunc (v *Varz) MarshalJSON() ([]byte, error)\n```\n\n```go\ntype VcapComponent struct {\n\tConfig     interface{}               `json:\"-\"`\n\tVarz       *Varz                     `json:\"-\"`\n\tHealthz    *Healthz                  `json:\"-\"`\n\tInfoRoutes map[string]json.Marshaler `json:\"-\"`\n\tLogger     lager.Logger              `json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *VcapComponent) ListenAndServe()\n```\n\n```go\nfunc (c *VcapComponent) Register(mbusClient *nats.Conn) error\n```\n\n```go\nfunc (c *VcapComponent) Start() error\n```\n\n```go\nfunc (c *VcapComponent) Stop()\n```\n\n```go\nfunc (c *VcapComponent) UpdateVarz()\n```\n\n","path":"github.com/cnelson/gorouter/common","name":"common","synopsis":"","isRedistributable":true}
