api

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2016 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIXED = 1 + iota
	THRESHOLD
)

Variables

This section is empty.

Functions

func NewCrudClientFromConfig

func NewCrudClientFromConfig(authOptions *shttp.AuthenticationOpts) *shttp.CrudClient

func NewRestClientFromConfig added in v0.4.0

func NewRestClientFromConfig(authOptions *shttp.AuthenticationOpts) *shttp.RestClient

func RegisterFlowApi

func RegisterFlowApi(s string, f *flow.Table, st storage.Storage, r *shttp.Server)

func RegisterTopologyApi

func RegisterTopologyApi(s string, g *graph.Graph, r *shttp.Server, tc *flow.TableClient, st storage.Storage)

Types

type Alert

type Alert struct {
	UUID        string
	Name        string
	Description string
	Select      string `valid:"nonzero"`
	Test        string `valid:"nonzero"`
	Action      string `valid:"nonzero"`
	Type        int
	Count       int
	CreateTime  time.Time
}

func NewAlert

func NewAlert() *Alert

func (*Alert) ID

func (a *Alert) ID() string

func (*Alert) SetID added in v0.4.0

func (a *Alert) SetID(i string)

type AlertApiHandler added in v0.5.0

type AlertApiHandler struct {
	BasicApiHandler
}

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

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 ApiResource

type ApiResource interface {
	ID() string
	SetID(string)
}

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 NewApi

func NewApi(server *shttp.Server, kapi etcd.KeysAPI) (*ApiServer, error)

func (*ApiServer) AsyncWatch

func (*ApiServer) Create

func (a *ApiServer) Create(n string, resource ApiResource) error

func (*ApiServer) Delete

func (a *ApiServer) Delete(n string, id string) error

func (*ApiServer) Get

func (a *ApiServer) Get(n string, id string) (ApiResource, bool)

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 embeded struct for the most part of the resources

func (*BasicApiHandler) AsyncWatch

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"`
}

func NewCapture

func NewCapture(query string, bpfFilter string) *Capture

func (*Capture) ID

func (c *Capture) ID() string

func (*Capture) SetID added in v0.4.0

func (c *Capture) SetID(i string)

type CaptureApiHandler added in v0.5.0

type CaptureApiHandler struct {
	BasicApiHandler
	Graph *graph.Graph
}

func (*CaptureApiHandler) Create added in v0.6.0

func (c *CaptureApiHandler) Create(r ApiResource) error

Create tests that resource GremlinQuery does not exists already

func (*CaptureApiHandler) Index added in v0.5.0

func (c *CaptureApiHandler) Index() map[string]ApiResource

func (*CaptureApiHandler) List added in v0.5.0

func (c *CaptureApiHandler) List() map[string]ApiResource

List returns the default list without any Count basically use by ondemand

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

type FlowApi

type FlowApi struct {
	Service   string
	FlowTable *flow.Table
	Storage   storage.Storage
}

type HandlerFunc

type HandlerFunc func(w http.ResponseWriter, r *http.Request)

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

type TopologyApi struct {
	Service     string
	Graph       *graph.Graph
	TableClient *flow.TableClient
	Storage     storage.Storage
}

Jump to

Keyboard shortcuts

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