Documentation
¶
Index ¶
- func NewCrudClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.CrudClient, error)
- func NewRestClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.RestClient, error)
- func RegisterFlowApi(s string, f *flow.Table, st storage.Storage, r *shttp.Server)
- func RegisterPacketInjectorApi(s string, pic *packet_injector.PacketInjectorClient, g *graph.Graph, ...)
- func RegisterTopologyApi(s string, g *graph.Graph, r *shttp.Server, tc *flow.TableClient, ...)
- type Alert
- type AlertApiHandler
- type AlertResourceHandler
- type ApiHandler
- type ApiResource
- type ApiResourceWatcher
- type ApiServer
- func (a *ApiServer) AsyncWatch(n string, f ApiWatcherCallback) StoppableWatcher
- func (a *ApiServer) Create(n string, resource ApiResource) error
- func (a *ApiServer) Delete(n string, id string) error
- func (a *ApiServer) Get(n string, id string) (ApiResource, bool)
- func (a *ApiServer) GetHandler(s string) ApiHandler
- func (a *ApiServer) Index(n string) map[string]ApiResource
- func (a *ApiServer) RegisterApiHandler(handler ApiHandler) error
- type ApiWatcherCallback
- type BasicApiHandler
- func (h *BasicApiHandler) AsyncWatch(f ApiWatcherCallback) StoppableWatcher
- func (h *BasicApiHandler) Create(resource ApiResource) error
- 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
- type BasicStoppableWatcher
- type Capture
- type CaptureApiHandler
- type CaptureResourceHandler
- type FlowApi
- type HandlerFunc
- type PacketInjectorApi
- type PacketParamsReq
- 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 ¶
func NewRestClientFromConfig(authOptions *shttp.AuthenticationOpts) (*shttp.RestClient, error)
func RegisterFlowApi ¶
func RegisterPacketInjectorApi ¶ added in v0.9.0
func RegisterPacketInjectorApi(s string, pic *packet_injector.PacketInjectorClient, g *graph.Graph, r *shttp.Server)
Types ¶
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 ¶
type AlertApiHandler struct {
BasicApiHandler
}
type AlertResourceHandler ¶
type AlertResourceHandler struct {
}
func (*AlertResourceHandler) Name ¶
func (a *AlertResourceHandler) Name() string
func (*AlertResourceHandler) New ¶
func (a *AlertResourceHandler) New() ApiResource
type ApiHandler ¶
type ApiHandler interface {
Name() string
New() ApiResource
Index() map[string]ApiResource
Get(id string) (ApiResource, bool)
Create(resource ApiResource) error
Delete(id string) error
AsyncWatch(f ApiWatcherCallback) StoppableWatcher
}
type ApiResourceWatcher ¶
type ApiResourceWatcher interface {
AsyncWatch(f ApiWatcherCallback) StoppableWatcher
}
type ApiServer ¶
type ApiServer struct {
HTTPServer *shttp.Server
EtcdKeyAPI etcd.KeysAPI
// contains filtered or unexported fields
}
func (*ApiServer) AsyncWatch ¶
func (a *ApiServer) AsyncWatch(n string, f ApiWatcherCallback) StoppableWatcher
func (*ApiServer) Create ¶
func (a *ApiServer) Create(n string, resource ApiResource) error
func (*ApiServer) GetHandler ¶
func (a *ApiServer) GetHandler(s string) ApiHandler
func (*ApiServer) Index ¶
func (a *ApiServer) Index(n string) map[string]ApiResource
func (*ApiServer) RegisterApiHandler ¶
func (a *ApiServer) RegisterApiHandler(handler ApiHandler) error
type ApiWatcherCallback ¶
type ApiWatcherCallback func(action string, id string, resource ApiResource)
type BasicApiHandler ¶
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 ¶
func (h *BasicApiHandler) AsyncWatch(f ApiWatcherCallback) StoppableWatcher
func (*BasicApiHandler) Create ¶
func (h *BasicApiHandler) Create(resource ApiResource) error
func (*BasicApiHandler) Delete ¶
func (h *BasicApiHandler) Delete(id string) error
func (*BasicApiHandler) Get ¶
func (h *BasicApiHandler) Get(id string) (ApiResource, bool)
func (*BasicApiHandler) Index ¶
func (h *BasicApiHandler) Index() map[string]ApiResource
func (*BasicApiHandler) Name ¶
func (h *BasicApiHandler) Name() string
func (*BasicApiHandler) New ¶
func (h *BasicApiHandler) New() ApiResource
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"`
Name string `json:"Name,omitempty"`
Description string `json:"Description,omitempty"`
Type string `json:"Type,omitempty"`
Count int `json:"Count,omitempty"`
}
type CaptureApiHandler ¶
type CaptureApiHandler struct {
BasicApiHandler
Graph *graph.Graph
}
func (*CaptureApiHandler) Create ¶ added in v0.9.0
func (c *CaptureApiHandler) Create(r ApiResource) error
Create tests that resource GremlinQuery does not exists already
func (*CaptureApiHandler) Index ¶
func (c *CaptureApiHandler) Index() map[string]ApiResource
func (*CaptureApiHandler) List ¶
func (c *CaptureApiHandler) List() map[string]ApiResource
List returns the default list without any Count basically use by ondemand
type CaptureResourceHandler ¶
type CaptureResourceHandler struct {
}
func (*CaptureResourceHandler) Name ¶
func (c *CaptureResourceHandler) Name() string
func (*CaptureResourceHandler) New ¶
func (c *CaptureResourceHandler) New() ApiResource
type HandlerFunc ¶
type HandlerFunc func(w http.ResponseWriter, r *http.Request)
type PacketInjectorApi ¶ added in v0.9.0
type PacketInjectorApi struct {
Service string
PIClient *packet_injector.PacketInjectorClient
Graph *graph.Graph
}
type PacketParamsReq ¶ added in v0.9.0
type ResourceHandler ¶
type ResourceHandler interface {
Name() string
New() ApiResource
}
type StoppableWatcher ¶
type StoppableWatcher interface {
Stop()
}
Source Files
¶
- alert.go
- api.go
- capture.go
- flow.go
- handler.go
- packet_injector.go
- topology.go
Click to show internal directories.
Click to hide internal directories.