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 APIHandler
- type APIInfo
- type APIResource
- type APIResourceWatcher
- type APIServer
- type APIWatcherCallback
- type Alert
- type AlertAPIHandler
- type AlertResourceHandler
- type BasicAPIHandler
- func (h *BasicAPIHandler) AsyncWatch(f APIWatcherCallback) StoppableWatcher
- func (h *BasicAPIHandler) Create(resource APIResource) error
- func (h *BasicAPIHandler) Decorate(resource APIResource)
- func (h *BasicAPIHandler) Delete(id string) error
- func (h *BasicAPIHandler) Get(id string) (APIResource, bool)
- func (h *BasicAPIHandler) Index() map[string]APIResource
- func (h *BasicAPIHandler) Name() string
- func (h *BasicAPIHandler) New() APIResource
- func (h *BasicAPIHandler) Unmarshal(b []byte) (resource APIResource, err error)
- type BasicStoppableWatcher
- type Capture
- type CaptureAPIHandler
- type CaptureResourceHandler
- type ConfigAPI
- type HandlerFunc
- type PacketInjectorAPI
- type PacketParamsReq
- type PcapAPI
- type ResourceHandler
- type StoppableWatcher
- type Topology
- type TopologyAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCrudClientFromConfig ¶
func NewCrudClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.CrudClient, error)
func NewRestClientFromConfig ¶ added in v0.4.0
func NewRestClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.RestClient, error)
func RegisterPacketInjectorAPI ¶ added in v0.10.0
func RegisterPacketInjectorAPI(pic *packet_injector.PacketInjectorClient, g *graph.Graph, r *shttp.Server)
func RegisterPcapAPI ¶ added in v0.10.0
func RegisterTopologyAPI ¶ added in v0.10.0
func RegisterTopologyAPI(r *shttp.Server, parser *traversal.GremlinTraversalParser)
Types ¶
type APIHandler ¶ added in v0.10.0
type APIHandler interface {
Name() string
New() APIResource
Index() map[string]APIResource
Get(id string) (APIResource, bool)
Decorate(resource APIResource)
Create(resource APIResource) error
Delete(id string) error
AsyncWatch(f APIWatcherCallback) StoppableWatcher
}
type APIResourceWatcher ¶ added in v0.10.0
type APIResourceWatcher interface {
AsyncWatch(f APIWatcherCallback) StoppableWatcher
}
type APIServer ¶ added in v0.10.0
type APIServer struct {
HTTPServer *shttp.Server
EtcdKeyAPI etcd.KeysAPI
ServiceType common.ServiceType
// contains filtered or unexported fields
}
func NewAPI ¶ added in v0.10.0
func (*APIServer) GetHandler ¶ added in v0.10.0
func (a *APIServer) GetHandler(s string) APIHandler
func (*APIServer) RegisterAPIHandler ¶ added in v0.10.0
func (a *APIServer) RegisterAPIHandler(handler APIHandler) error
type APIWatcherCallback ¶ added in v0.10.0
type APIWatcherCallback func(action string, id string, resource APIResource)
type Alert ¶
type Alert struct {
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
}
type AlertAPIHandler ¶ added in v0.10.0
type AlertAPIHandler struct {
BasicAPIHandler
}
func RegisterAlertAPI ¶ added in v0.10.0
func RegisterAlertAPI(apiServer *APIServer) (*AlertAPIHandler, error)
type AlertResourceHandler ¶ added in v0.5.0
type AlertResourceHandler struct {
}
func (*AlertResourceHandler) Name ¶ added in v0.5.0
func (a *AlertResourceHandler) Name() string
func (*AlertResourceHandler) New ¶ added in v0.5.0
func (a *AlertResourceHandler) New() APIResource
type BasicAPIHandler ¶ added in v0.10.0
type BasicAPIHandler struct {
ResourceHandler ResourceHandler
EtcdKeyAPI etcd.KeysAPI
}
basic implementation of an APIHandler, should be used as embedded struct for the most part of the resources
func (*BasicAPIHandler) AsyncWatch ¶ added in v0.10.0
func (h *BasicAPIHandler) AsyncWatch(f APIWatcherCallback) StoppableWatcher
func (*BasicAPIHandler) Create ¶ added in v0.10.0
func (h *BasicAPIHandler) Create(resource APIResource) error
func (*BasicAPIHandler) Decorate ¶ added in v0.10.0
func (h *BasicAPIHandler) Decorate(resource APIResource)
func (*BasicAPIHandler) Delete ¶ added in v0.10.0
func (h *BasicAPIHandler) Delete(id string) error
func (*BasicAPIHandler) Get ¶ added in v0.10.0
func (h *BasicAPIHandler) Get(id string) (APIResource, bool)
func (*BasicAPIHandler) Index ¶ added in v0.10.0
func (h *BasicAPIHandler) Index() map[string]APIResource
func (*BasicAPIHandler) Name ¶ added in v0.10.0
func (h *BasicAPIHandler) Name() string
func (*BasicAPIHandler) New ¶ added in v0.10.0
func (h *BasicAPIHandler) New() APIResource
func (*BasicAPIHandler) Unmarshal ¶ added in v0.10.0
func (h *BasicAPIHandler) Unmarshal(b []byte) (resource APIResource, err error)
type BasicStoppableWatcher ¶
type BasicStoppableWatcher struct {
// contains filtered or unexported fields
}
func (*BasicStoppableWatcher) Stop ¶
func (s *BasicStoppableWatcher) Stop()
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"`
}
type CaptureAPIHandler ¶ added in v0.10.0
type CaptureAPIHandler struct {
BasicAPIHandler
Graph *graph.Graph
}
func RegisterCaptureAPI ¶ added in v0.10.0
func RegisterCaptureAPI(apiServer *APIServer, g *graph.Graph) (*CaptureAPIHandler, error)
func (*CaptureAPIHandler) Create ¶ added in v0.10.0
func (c *CaptureAPIHandler) Create(r APIResource) error
Create tests that resource GremlinQuery does not exists already
func (*CaptureAPIHandler) Decorate ¶ added in v0.10.0
func (c *CaptureAPIHandler) Decorate(resource APIResource)
type CaptureResourceHandler ¶ added in v0.5.0
type CaptureResourceHandler struct {
}
func (*CaptureResourceHandler) Name ¶ added in v0.5.0
func (c *CaptureResourceHandler) Name() string
func (*CaptureResourceHandler) New ¶ added in v0.5.0
func (c *CaptureResourceHandler) New() APIResource
type ConfigAPI ¶ added in v0.10.0
type ConfigAPI struct {
// contains filtered or unexported fields
}
type HandlerFunc ¶
type HandlerFunc func(w http.ResponseWriter, r *http.Request)
type PacketInjectorAPI ¶ added in v0.10.0
type PacketInjectorAPI struct {
PIClient *packet_injector.PacketInjectorClient
Graph *graph.Graph
}
type PacketParamsReq ¶ added in v0.8.0
type ResourceHandler ¶
type ResourceHandler interface {
Name() string
New() APIResource
}
type StoppableWatcher ¶
type StoppableWatcher interface {
Stop()
}
type Topology ¶ added in v0.4.0
type Topology struct {
GremlinQuery string `json:"GremlinQuery,omitempty" valid:"isGremlinExpr"`
}
type TopologyAPI ¶ added in v0.10.0
type TopologyAPI struct {
// contains filtered or unexported fields
}
Source Files
¶
- alert.go
- api.go
- capture.go
- config.go
- handler.go
- packet_injector.go
- pcap.go
- topology.go
Click to show internal directories.
Click to hide internal directories.