qtypes

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channels

type Channels struct {
	Log       *bcast.Group
	Inventory *bcast.Group
	Tick      *bcast.Group
	Done      chan os.Signal
}

Channels holds the communication channels

type ContainerInfo

type ContainerInfo struct {
	Command       string `json:"_command"`
	ContainerID   string `json:"_container_id"`
	ContainerName string `json:"_container_name"`
	Created       string `json:"_created"`
	ImageID       string `json:"_image_id"`
	ImageName     string `json:"_image_name"`
	Tag           string `json:"_tag"`
}

ContainerInfo holds information when the message was emmited by a container

func (*ContainerInfo) GetCntInfo

func (ci *ContainerInfo) GetCntInfo() string

GetCntInfo returns string representation for logging

type DiscoveryFS added in v0.5.0

type DiscoveryFS struct {
	Discovery map[string]DiscoveryFilesystem `json:"discovery"`
	Timestamp int64                          `json:"timestamp"`
}

DiscoveryFS holds the structure for the file

type DiscoveryFilesystem added in v0.5.0

type DiscoveryFilesystem struct {
	Device       string            `json:"device"`
	FsOpts       map[string]string `json:"fsopts"`
	FsType       string            `json:"fstype"`
	Mountpoint   string            `json:"mountpoint"`
	Mountoptions []string          `json:"options"`
}

DiscoveryFilesystem holds one filesystem

type DiscoveryProcess added in v0.5.0

type DiscoveryProcess struct {
	Command   string             `json:"cmdline"`
	Exec      string             `json:"exe"`
	Groupname string             `json:"groupname"`
	Username  string             `json:"username"`
	Name      string             `json:"name"`
	Children  []DiscoveryProcess `json:"children"`
}

DiscoveryProcess holds a process entry plus it's potential children

type DiscoveryProcesses added in v0.5.0

type DiscoveryProcesses struct {
	Discovery map[string]DiscoveryProcess `json:"discovery"`
	Timestamp int64                       `json:"timestamp"`
}

DiscoveryProcesses holds a list of Processes

type GelfMsg

type GelfMsg struct {
	Version       string  `json:"version"`
	Host          string  `json:"host"`
	Msg           string  `json:"short_message"`
	Timestamp     float32 `json:"timestamp"`
	Level         int     `json:"level"`
	Command       string  `json:"_command"`
	ContainerID   string  `json:"_container_id"`
	ContainerName string  `json:"_container_name"`
	Created       string  `json:"_created"`
	ImageID       string  `json:"_image_id"`
	ImageName     string  `json:"_image_name"`
	Tag           string  `json:"_tag"`
}

GelfMsg holds a GELF message from a container

type ImageInfo added in v0.7.0

type ImageInfo struct {
	Name string `json:"_name"`
	ID   string `json:"_image_id"`
}

ImageInfo holds information about a docker image

type QWorker added in v0.6.0

type QWorker struct {
	Cfg   *config.Config
	QChan Channels
	Subs  mapset.Set
}

QWorker

func (*QWorker) AddSub added in v0.6.0

func (qw *QWorker) AddSub(sub string)

AddSub puts subscription in set

func (*QWorker) RmSub added in v0.6.0

func (qw *QWorker) RmSub(sub string)

RmSub removes subscription from set

type QWorkers added in v0.6.0

type QWorkers interface {
	Run()
}

QWorkers provides the basic function each worker must implement

type Qmsg

type Qmsg struct {
	Version     string        `json:"version"`
	Type        string        `json:"type"`
	Action      string        `json:"action"`
	Source      string        `json:"source"`
	Host        string        `json:"host"`
	Msg         string        `json:"short_message"`
	Time        time.Time     `json:"time"`
	Level       int           `json:"level"`
	IsContainer bool          `json:"is_container"`
	Container   ContainerInfo `json:"container"`
	Image       ImageInfo     `json:"container"`
}

Qmsg holds a GELF message from a container

func NewQmsg

func NewQmsg(source, msg, host string) Qmsg

NewQmsg create an instance of Log

func (*Qmsg) GetCntInfo

func (qm *Qmsg) GetCntInfo() string

GetCntInfo returns container info if a container is involved, an empty string otherwise

func (*Qmsg) SetContainer

func (qm *Qmsg) SetContainer(cnt ContainerInfo) Qmsg

SetContainer sets information about the container

func (*Qmsg) SetImage added in v0.7.0

func (qm *Qmsg) SetImage(img ImageInfo) Qmsg

SetImage sets information about the image

func (*Qmsg) SetTimestamp

func (qm *Qmsg) SetTimestamp(ts time.Time) Qmsg

SetTimestamp updates the Timestamp attribute

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL