Documentation ¶
Index ¶
- Constants
- Variables
- func GetCache(w http.ResponseWriter, _ *http.Request)
- func GetConnections(w http.ResponseWriter, _ *http.Request)
- func GetHost(ip string) hosts.Host
- func SetCache(_ http.ResponseWriter, r *http.Request)
- func SetRoutes(httpService *chi.Mux)
- func UpdateConntrackEntries(nodeName string) error
- type ConntrackCount
- type ConntrackUpdater
- type HostCache
- type HostCacheUpdater
- type Server
Constants ¶
View Source
const ( TcpProtoNum = 6 UdpProtoNum = 17 )
View Source
const IpsAssuredBit = 2
Variables ¶
View Source
var TCPStateStrings = [...]string{"TCP_ESTABLISHED", "TCP_SYN_SENT", "TCP_SYN_RECV", "TCP_FIN_WAIT1", "TCP_FIN_WAIT2", "TCP_TIME_WAIT", "TCP_CLOSE", "TCP_CLOSE_WAIT", "TCP_LAST_ACK", "TCP_LISTEN", "TCP_CLOSING"}
Functions ¶
func GetConnections ¶
func GetConnections(w http.ResponseWriter, _ *http.Request)
GetConnections return conntrack counts in prometheus format
func SetCache ¶
func SetCache(_ http.ResponseWriter, r *http.Request)
SetCache sets the entire cache
func UpdateConntrackEntries ¶
UpdateConntrackEntries build the conntrack counts cache from conntrack table
Types ¶
type ConntrackCount ¶
type ConntrackCount struct { Node string `json:"node"` Count int `json:"count"` OriginSrc hosts.Host `json:"originSrc"` SourceIP string `json:"sourceIP"` OriginDst hosts.Host `json:"originDst"` DestinationIP string `json:"destinationIP"` DestinationPort uint16 `json:"destinationPort"` ReplySrc hosts.Host `json:"replySrc"` ReplyDst hosts.Host `json:"replyDst"` State string `json:"state"` ReplyState string `json:"repState"` Transport string `json:"transport"` }
ConntrackCount count of conntrack entries with same tags
type ConntrackUpdater ¶
type ConntrackUpdater struct {
// contains filtered or unexported fields
}
ConntrackUpdater controller for updating conntrack counts (cache)
func NewConntrackUpdater ¶
func NewConntrackUpdater(nodeName string, periodSeconds int, wg *sync.WaitGroup) ConntrackUpdater
NewConntrackUpdater new ConntrackUpdater
func (*ConntrackUpdater) StartConntrackUpdater ¶
func (c *ConntrackUpdater) StartConntrackUpdater()
StartConntrackUpdater start ConntrackUpdater
func (*ConntrackUpdater) StopConntrackUpdater ¶
func (c *ConntrackUpdater) StopConntrackUpdater()
StopConntrackUpdater stop ConntrackUpdater
type HostCache ¶
func NewHostCache ¶
func NewHostCache() *HostCache
type HostCacheUpdater ¶
type HostCacheUpdater struct { NodeName string RegistryURL string UpdatePeriod int // contains filtered or unexported fields }
HostCacheUpdater builds and serves host cache
func NewHostCacheUpdater ¶
func NewHostCacheUpdater(nodeName string, registryURL string, updatePeriod int, wg *sync.WaitGroup) HostCacheUpdater
NewHostCacheUpdater create new HostCacheUpdater
func (*HostCacheUpdater) StartHostCacheUpdater ¶
func (c *HostCacheUpdater) StartHostCacheUpdater()
StartHostCacheUpdater HostCacheUpdater
func (*HostCacheUpdater) StopHostCacheUpdater ¶
func (c *HostCacheUpdater) StopHostCacheUpdater()
StopHostCacheUpdater stopCh
Click to show internal directories.
Click to hide internal directories.