Documentation ¶
Index ¶
- func Cache(con *RancherInfo)
- func DeleteFromCache(cId string) bool
- func ExistsInCache(containerID string) bool
- func GetLogstashFields(c *docker.Container, a *LogstashAdapter) map[string]string
- func GetRancherId(cID string) *client.Container
- func NewLogstashAdapter(route *router.Route) (router.LogAdapter, error)
- type DockerInfo
- type LogstashAdapter
- type RancherContainer
- type RancherInfo
- type RancherStack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFromCache ¶
func ExistsInCache ¶
Check if the container data already exists in the cached map
func GetLogstashFields ¶
func GetLogstashFields(c *docker.Container, a *LogstashAdapter) map[string]string
Parse the logstash fields env variables
func GetRancherId ¶
func GetRancherId(cID string) *client.Container
Uses the passed docker id to find the rancher Id
func NewLogstashAdapter ¶
func NewLogstashAdapter(route *router.Route) (router.LogAdapter, error)
NewLogstashAdapter creates a LogstashAdapter with UDP as the default transport.
Types ¶
type DockerInfo ¶
type DockerInfo struct { Name string `json:"name"` ID string `json:"id"` Image string `json:"image"` Hostname string `json:"hostname"` }
Container Docker info for event data
type LogstashAdapter ¶
type LogstashAdapter struct {
// contains filtered or unexported fields
}
LogstashAdapter is an adapter that streams UDP JSON to Logstash.
func (*LogstashAdapter) Stream ¶
func (a *LogstashAdapter) Stream(logstream chan *router.Message)
Stream implements the router.LogAdapter interface.
type RancherContainer ¶
type RancherContainer struct { Name string `json:"name"` // io.rancher.container.name IP string `json:"ip,omitempty"` // io.rancher.container.ip ID string `json:"once,omitempty"` // io.rancher.container.start_once HostID string `json:"hostId,omitempty"` DockerID string `json:"dockerId,omitempty"` }
Rancher container data for event
type RancherInfo ¶
type RancherInfo struct { Environment string `json:"environment,omitempty"` Container *RancherContainer `json:"container,omitempty"` Stack *RancherStack `json:"stack,omitempty"` }
Rancher data for evetn data
func GetRancherInfo ¶
func GetRancherInfo(c *docker.Container) *RancherInfo
Get the rancher meteadata from the api/cahce
type RancherStack ¶
type RancherStack struct { Service string `json:"service,omitempty"` // Service Name from API StackName string `json:"stackName,omitempty"` // io.rancher.stack.name StackState string `json:"stackState,omitempty"` }
Rancher stack inf for event
Click to show internal directories.
Click to hide internal directories.