server

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 26 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TopologyMarshallers = api.TopologyMarshallers{
	"text/vnd.graphviz":            dotMarshaller,
	"application/vnd.tcpdump.pcap": pcapMarshaller,
}

TopologyMarshallers hold the dot and pcap marshallers

Functions

func NewWorkflowRuntime added in v0.23.0

func NewWorkflowRuntime(g *graph.Graph, tr *traversal.GremlinTraversalParser, server *api.Server) (*js.Runtime, error)

NewWorkflowRuntime returns a new Workflow runtime

func RegisterConfigAPI

func RegisterConfigAPI(r *shttp.Server, authBackend shttp.AuthenticationBackend)

RegisterConfigAPI registers a configuration endpoint (read only) in API server

func RegisterPcapAPI

func RegisterPcapAPI(r *shttp.Server, store storage.Storage, authBackend shttp.AuthenticationBackend)

RegisterPcapAPI registers a new pcap injector API

func RegisterWorkflowCallAPI added in v0.23.0

func RegisterWorkflowCallAPI(s *shttp.Server, authBackend shttp.AuthenticationBackend, apiServer *api.Server, g *graph.Graph, tr *traversal.GremlinTraversalParser) error

RegisterWorkflowCallAPI registers a new workflow call api handler

Types

type AlertAPIHandler

type AlertAPIHandler struct {
	rest.BasicAPIHandler
}

AlertAPIHandler aims to exposes the Alert API.

func RegisterAlertAPI

func RegisterAlertAPI(apiServer *api.Server, authBackend shttp.AuthenticationBackend) (*AlertAPIHandler, error)

RegisterAlertAPI registers an Alert's API to a designated API Server

type AlertResourceHandler

type AlertResourceHandler struct {
	rest.ResourceHandler
}

AlertResourceHandler aims to creates and manage a new Alert.

func (*AlertResourceHandler) Name

func (a *AlertResourceHandler) Name() string

Name returns resource name "alert"

func (*AlertResourceHandler) New

New creates a new alert

type CaptureAPIHandler

type CaptureAPIHandler struct {
	rest.BasicAPIHandler
	Graph *graph.Graph
}

CaptureAPIHandler based on BasicAPIHandler

func RegisterCaptureAPI

func RegisterCaptureAPI(apiServer *api.Server, g *graph.Graph, authBackend shttp.AuthenticationBackend) (*CaptureAPIHandler, error)

RegisterCaptureAPI registers an new resource, capture

func (*CaptureAPIHandler) Create

func (c *CaptureAPIHandler) Create(r rest.Resource, opts *rest.CreateOptions) error

Create tests that resource GremlinQuery does not exists already

func (*CaptureAPIHandler) Decorate

func (c *CaptureAPIHandler) Decorate(resource rest.Resource)

Decorate populates the capture resource

func (*CaptureAPIHandler) Update added in v0.27.0

func (c *CaptureAPIHandler) Update(id string, resource rest.Resource) (rest.Resource, bool, error)

Update a capture

type CaptureResourceHandler

type CaptureResourceHandler struct {
	rest.ResourceHandler
}

CaptureResourceHandler describes a capture ressouce handler

func (*CaptureResourceHandler) Name

func (c *CaptureResourceHandler) Name() string

Name returns "capture"

func (*CaptureResourceHandler) New

New creates a new capture resource

type EdgeAPIHandler added in v0.27.0

type EdgeAPIHandler struct {
	// contains filtered or unexported fields
}

EdgeAPIHandler aims to exposes the Alert API.

func RegisterEdgeAPI added in v0.27.0

func RegisterEdgeAPI(apiServer *api.Server, g *graph.Graph, authBackend shttp.AuthenticationBackend) (*EdgeAPIHandler, error)

RegisterEdgeAPI registers the edge API

func (*EdgeAPIHandler) Create added in v0.27.0

func (h *EdgeAPIHandler) Create(resource rest.Resource, createOpts *rest.CreateOptions) error

Create adds the specified edge to the graph

func (*EdgeAPIHandler) Decorate added in v0.27.0

func (h *EdgeAPIHandler) Decorate(resource rest.Resource)

Decorate the specified edge

func (*EdgeAPIHandler) Delete added in v0.27.0

func (h *EdgeAPIHandler) Delete(id string) error

Delete the edge with the specified id from the graph

func (*EdgeAPIHandler) Get added in v0.27.0

func (h *EdgeAPIHandler) Get(id string) (rest.Resource, bool)

Get returns a edge with the specified id

func (*EdgeAPIHandler) Index added in v0.27.0

func (h *EdgeAPIHandler) Index() map[string]rest.Resource

Index returns the list of existing edges

func (*EdgeAPIHandler) Name added in v0.27.0

func (h *EdgeAPIHandler) Name() string

Name returns resource name "edge"

func (*EdgeAPIHandler) New added in v0.27.0

func (h *EdgeAPIHandler) New() rest.Resource

New creates a new edge

func (*EdgeAPIHandler) Update added in v0.27.0

func (h *EdgeAPIHandler) Update(id string, resource rest.Resource) (rest.Resource, bool, error)

Update a edge metadata

type EdgeResourceHandler added in v0.27.0

type EdgeResourceHandler struct {
	rest.ResourceHandler
}

EdgeResourceHandler aims to creates and manage a new Alert.

type EdgeRuleAPI added in v0.19.1

type EdgeRuleAPI struct {
	rest.BasicAPIHandler
	Graph *graph.Graph
}

EdgeRuleAPI based on BasicAPIHandler

func RegisterEdgeRuleAPI added in v0.19.1

func RegisterEdgeRuleAPI(apiServer *api.Server, g *graph.Graph, authBackend shttp.AuthenticationBackend) (*EdgeRuleAPI, error)

RegisterEdgeRuleAPI registers an EdgeRule's API to a designated API Server

func (*EdgeRuleAPI) Update added in v0.27.0

func (a *EdgeRuleAPI) Update(id string, resource rest.Resource) (rest.Resource, bool, error)

Update an edge rule

type EdgeRuleResourceHandler added in v0.19.1

type EdgeRuleResourceHandler struct {
	rest.ResourceHandler
}

EdgeRuleResourceHandler describes a edge rule resource handler

func (*EdgeRuleResourceHandler) Name added in v0.19.1

func (erh *EdgeRuleResourceHandler) Name() string

Name returns resource name "edgerule"

func (*EdgeRuleResourceHandler) New added in v0.19.1

New creates a new EdgeRule

type NodeAPIHandler added in v0.27.0

type NodeAPIHandler struct {
	// contains filtered or unexported fields
}

NodeAPIHandler aims to exposes the Alert API.

func RegisterNodeAPI added in v0.27.0

func RegisterNodeAPI(apiServer *api.Server, g *graph.Graph, authBackend shttp.AuthenticationBackend) (*NodeAPIHandler, error)

RegisterNodeAPI registers the node API

func (*NodeAPIHandler) Create added in v0.27.0

func (h *NodeAPIHandler) Create(resource rest.Resource, createOpts *rest.CreateOptions) error

Create adds the specified node to the graph

func (*NodeAPIHandler) Decorate added in v0.27.0

func (h *NodeAPIHandler) Decorate(resource rest.Resource)

Decorate the specified node

func (*NodeAPIHandler) Delete added in v0.27.0

func (h *NodeAPIHandler) Delete(id string) error

Delete the node with the specified id from the graph

func (*NodeAPIHandler) Get added in v0.27.0

func (h *NodeAPIHandler) Get(id string) (rest.Resource, bool)

Get returns a node with the specified id

func (*NodeAPIHandler) Index added in v0.27.0

func (h *NodeAPIHandler) Index() map[string]rest.Resource

Index returns the list of existing nodes

func (*NodeAPIHandler) Name added in v0.27.0

func (h *NodeAPIHandler) Name() string

Name returns resource name "node"

func (*NodeAPIHandler) New added in v0.27.0

func (h *NodeAPIHandler) New() rest.Resource

New creates a new node

func (*NodeAPIHandler) Update added in v0.27.0

func (h *NodeAPIHandler) Update(id string, resource rest.Resource) (rest.Resource, bool, error)

Update a node metadata

type NodeResourceHandler added in v0.27.0

type NodeResourceHandler struct {
	rest.ResourceHandler
}

NodeResourceHandler aims to creates and manage a new Alert.

type NodeRuleAPI added in v0.19.1

type NodeRuleAPI struct {
	rest.BasicAPIHandler
	Graph *graph.Graph
}

NodeRuleAPI based on BasicAPIHandler

func RegisterNodeRuleAPI added in v0.19.1

func RegisterNodeRuleAPI(apiServer *api.Server, g *graph.Graph, authBackend shttp.AuthenticationBackend) (*NodeRuleAPI, error)

RegisterNodeRuleAPI register a new node rule api handler

func (*NodeRuleAPI) Update added in v0.27.0

func (a *NodeRuleAPI) Update(id string, resource rest.Resource) (rest.Resource, bool, error)

Update an edge rule

type NodeRuleResourceHandler added in v0.19.1

type NodeRuleResourceHandler struct {
	rest.ResourceHandler
}

NodeRuleResourceHandler describes a node resource handler

func (*NodeRuleResourceHandler) Name added in v0.19.1

func (nrh *NodeRuleResourceHandler) Name() string

Name returns resource name "noderule"

func (*NodeRuleResourceHandler) New added in v0.19.1

New creates a new node rule

type PacketInjectorAPI

type PacketInjectorAPI struct {
	rest.BasicAPIHandler
	Graph *graph.Graph
}

PacketInjectorAPI exposes the packet injector API

func RegisterPacketInjectorAPI

func RegisterPacketInjectorAPI(g *graph.Graph, apiServer *api.Server, authBackend shttp.AuthenticationBackend) (*PacketInjectorAPI, error)

RegisterPacketInjectorAPI registers a new packet injector resource in the API

func (*PacketInjectorAPI) Create

func (pi *PacketInjectorAPI) Create(r rest.Resource, opts *rest.CreateOptions) error

Create allocates a new packet injection

func (*PacketInjectorAPI) Update added in v0.27.0

func (pi *PacketInjectorAPI) Update(id string, resource rest.Resource) (rest.Resource, bool, error)

Update a packet injection

type PcapAPI

type PcapAPI struct {
	// contains filtered or unexported fields
}

PcapAPI exposes the pcap injector API

func (*PcapAPI) SendFlows added in v0.24.0

func (p *PcapAPI) SendFlows(flows []*flow.Flow)

SendFlows implements the flow Sender interface

func (*PcapAPI) SendStats added in v0.26.0

func (p *PcapAPI) SendStats(status flow.Stats)

SendStats implements the flow Sender interface

type WorkflowAPIHandler added in v0.19.0

type WorkflowAPIHandler struct {
	rest.BasicAPIHandler
}

WorkflowAPIHandler based on BasicAPIHandler

func RegisterWorkflowAPI added in v0.19.0

func RegisterWorkflowAPI(apiServer *api.Server, authBackend shttp.AuthenticationBackend) (*WorkflowAPIHandler, error)

RegisterWorkflowAPI registers a new workflow api handler

func (*WorkflowAPIHandler) Create added in v0.19.0

Create tests whether the resource is a duplicate or is unique

func (*WorkflowAPIHandler) Get added in v0.19.0

func (w *WorkflowAPIHandler) Get(id string) (rest.Resource, bool)

Get retrieves a workflow based on its id

func (*WorkflowAPIHandler) Index added in v0.19.0

func (w *WorkflowAPIHandler) Index() map[string]rest.Resource

Index returns a map of workflows indexed by id

type WorkflowCallAPIHandler added in v0.23.0

type WorkflowCallAPIHandler struct {
	// contains filtered or unexported fields
}

WorkflowCallAPIHandler based on BasicAPIHandler

type WorkflowResourceHandler added in v0.19.0

type WorkflowResourceHandler struct {
}

WorkflowResourceHandler describes a workflow resource handler

func (*WorkflowResourceHandler) Name added in v0.19.0

func (w *WorkflowResourceHandler) Name() string

Name return "workflow"

func (*WorkflowResourceHandler) New added in v0.19.0

New creates a new workflow resource

Jump to

Keyboard shortcuts

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