{"modulePath":"github.com/bodgit/gorouter","version":"v0.0.0-20140725001424-64d2d54ca558","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 GrabEphemeralPort() (port uint16, err error)\n```\n\n```go\nfunc LocalIP() (string, 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// 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) AddRecord(record *steno.Record)\n```\n\n```go\nfunc (lc *LogCounter) Flush()\n```\n\n```go\nfunc (lc *LogCounter) GetCodec() steno.Codec\n```\n\n```go\nfunc (lc *LogCounter) GetCount(key string) int\n```\n\n```go\nfunc (lc *LogCounter) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (lc *LogCounter) SetCodec(codec steno.Codec)\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}\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\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (v *Varz) MarshalJSON() ([]byte, error)\n```\n\n```go\ntype VcapComponent 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\tConfig      interface{}               `json:\"-\"`\n\tVarz        *Varz                     `json:\"-\"`\n\tHealthz     *Healthz                  `json:\"-\"`\n\tInfoRoutes  map[string]json.Marshaler `json:\"-\"`\n\tLogger      *steno.Logger             `json:\"-\"`\n\n\t// These fields are automatically generated\n\tUUID      string   `json:\"uuid\"`\n\tStartTime Time     `json:\"start\"`\n\tUptime    Duration `json:\"uptime\"`\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 yagnats.NATSClient) 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/bodgit/gorouter/common","name":"common","synopsis":"","isRedistributable":true}
