 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- func NewCrudClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.CrudClient, error)
- func NewRestClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.RestClient, error)
- func RegisterConfigAPI(r *shttp.Server)
- func RegisterPacketInjectorAPI(pic *packet_injector.PacketInjectorClient, g *graph.Graph, r *shttp.Server)
- func RegisterPcapAPI(r *shttp.Server, store storage.Storage)
- func RegisterTopologyAPI(r *shttp.Server, parser *traversal.GremlinTraversalParser)
- type Alert
- type AlertAPIHandler
- type AlertResourceHandler
- type BasicAPIHandler
- func (h *BasicAPIHandler) AsyncWatch(f WatcherCallback) StoppableWatcher
- func (h *BasicAPIHandler) Create(resource Resource) error
- func (h *BasicAPIHandler) Decorate(resource Resource)
- func (h *BasicAPIHandler) Delete(id string) error
- func (h *BasicAPIHandler) Get(id string) (Resource, bool)
- func (h *BasicAPIHandler) Index() map[string]Resource
- func (h *BasicAPIHandler) Name() string
- func (h *BasicAPIHandler) New() Resource
- func (h *BasicAPIHandler) Unmarshal(b []byte) (resource Resource, err error)
 
- type BasicStoppableWatcher
- type Capture
- type CaptureAPIHandler
- type CaptureResourceHandler
- type Handler
- type HandlerFunc
- type Info
- type PacketInjectorAPI
- type PacketParamsReq
- type PcapAPI
- type Resource
- type ResourceHandler
- type ResourceWatcher
- type Server
- type StoppableWatcher
- type TopologyAPI
- type TopologyParam
- type WatcherCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCrudClientFromConfig ¶
func NewCrudClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.CrudClient, error)
NewCrudClientFromConfig creates a new REST client on /api
func NewRestClientFromConfig ¶ added in v0.5.0
func NewRestClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.RestClient, error)
NewRestClientFromConfig creates a new REST client
func RegisterConfigAPI ¶ added in v0.12.0
RegisterConfigAPI registers a configuration endpoint (read only) in API server
func RegisterPacketInjectorAPI ¶ added in v0.12.0
func RegisterPacketInjectorAPI(pic *packet_injector.PacketInjectorClient, g *graph.Graph, r *shttp.Server)
RegisterPacketInjectorAPI registers a new packet injector ressource in the API
func RegisterPcapAPI ¶ added in v0.12.0
RegisterPcapAPI registers a new pcap injector API
func RegisterTopologyAPI ¶ added in v0.12.0
func RegisterTopologyAPI(r *shttp.Server, parser *traversal.GremlinTraversalParser)
RegisterTopologyAPI registers a new topology query API
Types ¶
type Alert ¶
type Alert struct {
	Resource
	UUID        string
	Name        string `json:",omitempty"`
	Description string `json:",omitempty"`
	Expression  string `json:",omitempty" valid:"nonzero"`
	Action      string `json:",omitempty" valid:"regexp=^(|http://|https://|file://).*$"`
	Trigger     string `json:",omitempty" valid:"regexp=^(graph|duration:.+|)$"`
	CreateTime  time.Time
}
    Alert is a set of parameters, the Alert Action will Trigger according to its Expression.
type AlertAPIHandler ¶ added in v0.12.0
type AlertAPIHandler struct {
	BasicAPIHandler
}
    AlertAPIHandler aims to exposes the Alert API.
func RegisterAlertAPI ¶ added in v0.12.0
func RegisterAlertAPI(apiServer *Server) (*AlertAPIHandler, error)
RegisterAlertAPI registers an Alert's API to a designated API Server
type AlertResourceHandler ¶ added in v0.5.0
type AlertResourceHandler struct {
	ResourceHandler
}
    AlertResourceHandler aims to creates and manage a new Alert.
func (*AlertResourceHandler) Name ¶ added in v0.5.0
func (a *AlertResourceHandler) Name() string
Name returns ressource name "alert"
func (*AlertResourceHandler) New ¶ added in v0.5.0
func (a *AlertResourceHandler) New() Resource
New creates a new alert
type BasicAPIHandler ¶ added in v0.12.0
type BasicAPIHandler struct {
	ResourceHandler ResourceHandler
	EtcdKeyAPI      etcd.KeysAPI
}
    BasicAPIHandler basic implementation of an Handler, should be used as embedded struct for the most part of the resources
func (*BasicAPIHandler) AsyncWatch ¶ added in v0.12.0
func (h *BasicAPIHandler) AsyncWatch(f WatcherCallback) StoppableWatcher
AsyncWatch registers a new resource watcher
func (*BasicAPIHandler) Create ¶ added in v0.12.0
func (h *BasicAPIHandler) Create(resource Resource) error
Create a new resource in Etcd
func (*BasicAPIHandler) Decorate ¶ added in v0.12.0
func (h *BasicAPIHandler) Decorate(resource Resource)
Decorate the resource
func (*BasicAPIHandler) Delete ¶ added in v0.12.0
func (h *BasicAPIHandler) Delete(id string) error
Delete a resource
func (*BasicAPIHandler) Get ¶ added in v0.12.0
func (h *BasicAPIHandler) Get(id string) (Resource, bool)
Get a specific resource
func (*BasicAPIHandler) Index ¶ added in v0.12.0
func (h *BasicAPIHandler) Index() map[string]Resource
Index returns the list of resource available in Etcd
func (*BasicAPIHandler) Name ¶ added in v0.12.0
func (h *BasicAPIHandler) Name() string
Name returns the resource name
func (*BasicAPIHandler) New ¶ added in v0.12.0
func (h *BasicAPIHandler) New() Resource
New creates a new resource
func (*BasicAPIHandler) Unmarshal ¶ added in v0.12.0
func (h *BasicAPIHandler) Unmarshal(b []byte) (resource Resource, err error)
Unmarshal deserialize a resource
type BasicStoppableWatcher ¶
type BasicStoppableWatcher struct {
	StoppableWatcher
	// contains filtered or unexported fields
}
    BasicStoppableWatcher basic implementation of a ressources watcher
func (*BasicStoppableWatcher) Stop ¶
func (s *BasicStoppableWatcher) Stop()
Stop the resource watcher
type Capture ¶
type Capture struct {
	UUID           string
	GremlinQuery   string `json:"GremlinQuery,omitempty" valid:"isGremlinExpr"`
	BPFFilter      string `json:"BPFFilter,omitempty" valid:"isBPFFilter"`
	Name           string `json:"Name,omitempty"`
	Description    string `json:"Description,omitempty"`
	Type           string `json:"Type,omitempty"`
	Count          int    `json:"Count,omitempty"`
	PCAPSocket     string `json:"PCAPSocket,omitempty"`
	Port           int    `json:"Port,omitempty"`
	RawPacketLimit int    `json:"RawPacketLimit,omitempty" valid:"isValidRawPacketLimit"`
	HeaderSize     int    `json:"HeaderSize,omitempty" valid:"isValidCaptureHeaderSize"`
}
    Capture describes a capture API
func NewCapture ¶
NewCapture creates a new capture
type CaptureAPIHandler ¶ added in v0.12.0
type CaptureAPIHandler struct {
	BasicAPIHandler
	Graph *graph.Graph
}
    CaptureAPIHandler based on BasicAPIHandler
func RegisterCaptureAPI ¶ added in v0.12.0
func RegisterCaptureAPI(apiServer *Server, g *graph.Graph) (*CaptureAPIHandler, error)
RegisterCaptureAPI registers an new resource, capture
func (*CaptureAPIHandler) Create ¶ added in v0.12.0
func (c *CaptureAPIHandler) Create(r Resource) error
Create tests that resource GremlinQuery does not exists already
func (*CaptureAPIHandler) Decorate ¶ added in v0.12.0
func (c *CaptureAPIHandler) Decorate(resource Resource)
Decorate populates the capture resource
type CaptureResourceHandler ¶ added in v0.5.0
type CaptureResourceHandler struct {
	ResourceHandler
}
    CaptureResourceHandler describes a capture ressouce handler
func (*CaptureResourceHandler) Name ¶ added in v0.5.0
func (c *CaptureResourceHandler) Name() string
Name returns "capture"
func (*CaptureResourceHandler) New ¶ added in v0.5.0
func (c *CaptureResourceHandler) New() Resource
New creates a new capture resource
type Handler ¶ added in v0.12.0
type Handler interface {
	Name() string
	New() Resource
	Index() map[string]Resource
	Get(id string) (Resource, bool)
	Decorate(resource Resource)
	Create(resource Resource) error
	Delete(id string) error
	AsyncWatch(f WatcherCallback) StoppableWatcher
}
    Handler describes resources for each API
type HandlerFunc ¶
type HandlerFunc func(w http.ResponseWriter, r *http.Request)
HandlerFunc describes an http(s) router handler callback function
type Info ¶ added in v0.12.0
Info for each host describes his API version and service (agent or analyzer)
type PacketInjectorAPI ¶ added in v0.12.0
type PacketInjectorAPI struct {
	PIClient *packet_injector.PacketInjectorClient
	Graph    *graph.Graph
}
    PacketInjectorAPI exposes the packet injector API
type PacketParamsReq ¶ added in v0.9.0
type PacketParamsReq struct {
	Src        string
	Dst        string
	SrcIP      string
	DstIP      string
	SrcMAC     string
	DstMAC     string
	SrcPort    int64
	DstPort    int64
	Type       string
	Payload    string
	TrackingID string
	ID         int64
	Count      int64
	Interval   int64
}
    PacketParamsReq packet injector API parameters
type PcapAPI ¶ added in v0.12.0
PcapAPI exposes the pcap injector API
type Resource ¶ added in v0.12.0
Resource used as interface resources for each API
type ResourceHandler ¶
ResourceHandler aims to creates new resource of an API
type ResourceWatcher ¶ added in v0.12.0
type ResourceWatcher interface {
	AsyncWatch(f WatcherCallback) StoppableWatcher
}
    ResourceWatcher asynchronous interface
type Server ¶ added in v0.12.0
type Server struct {
	HTTPServer  *shttp.Server
	EtcdKeyAPI  etcd.KeysAPI
	ServiceType common.ServiceType
	// contains filtered or unexported fields
}
    Server object are created once for each ServiceType (agent or analyzer)
func NewAPI ¶ added in v0.12.0
func NewAPI(server *shttp.Server, kapi etcd.KeysAPI, serviceType common.ServiceType) (*Server, error)
NewAPI creates a new API server based on http
func (*Server) GetHandler ¶ added in v0.12.0
GetHandler returns the hander named hname
type TopologyAPI ¶ added in v0.12.0
type TopologyAPI struct {
	// contains filtered or unexported fields
}
    TopologyAPI exposes the topology query API
       Source Files
      ¶
      Source Files
      ¶
    
- alert.go
- api.go
- capture.go
- config.go
- handler.go
- packet_injector.go
- pcap.go
- topology.go