api

package
v1.7.1-0...-29a0ac7 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2016 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFound    = ApiError(404, "Not found", nil)
	ServerError = ApiError(500, "Server error", nil)
)

Functions

func ElasticsearchProxy

func ElasticsearchProxy(c *middleware.Context)

func EmitAddMonitor

func EmitAddMonitor(event *events.MonitorCreated) error

func EmitDeleteMonitor

func EmitDeleteMonitor(event *events.MonitorRemoved) error

func EmitEvent

func EmitEvent(collectorId int64, eventName string, event interface{}) error

func EmitUpdateMonitor

func EmitUpdateMonitor(event *events.MonitorUpdated) error

func GraphiteProxy

func GraphiteProxy(c *middleware.Context)

func HandleCollectorConnected

func HandleCollectorConnected(event *events.CollectorConnected) error

func HandleCollectorDisconnected

func HandleCollectorDisconnected(event *events.CollectorDisconnected) error

func HandleCollectorUpdated

func HandleCollectorUpdated(event *events.CollectorUpdated) error

func Heartbeat

func Heartbeat(c *middleware.Context)

func InitCollectorController

func InitCollectorController(metrics met.Backend)

func NotFoundHandler

func NotFoundHandler(c *middleware.Context)

func Register

func Register(r *macaron.Macaron)

Register adds http routes

func SocketIO

func SocketIO(c *middleware.Context)

Types

type BinMessage

type BinMessage struct {
	Payload *socketio.Attachment
}

type CollectorContext

type CollectorContext struct {
	*m.SignedInUser
	Collector     *m.CollectorDTO
	Socket        socketio.Socket
	SocketId      string
	MonitorsIndex map[int64]*m.MonitorDTO // index of monitors by Id
	VersionMajor  int64
	VersionMinor  float64
}

func (*CollectorContext) EmitReady

func (c *CollectorContext) EmitReady() error

func (*CollectorContext) OnDisconnection

func (c *CollectorContext) OnDisconnection()

func (*CollectorContext) OnEvent

func (c *CollectorContext) OnEvent(msg *schema.ProbeEvent)

func (*CollectorContext) OnEventOld

func (c *CollectorContext) OnEventOld(msg *probeEventOld)

func (*CollectorContext) OnResults

func (c *CollectorContext) OnResults(results []*schema.MetricData)

func (*CollectorContext) Refresh

func (c *CollectorContext) Refresh()

func (*CollectorContext) Remove

func (c *CollectorContext) Remove() error

func (*CollectorContext) Save

func (c *CollectorContext) Save() error

func (*CollectorContext) Update

func (c *CollectorContext) Update() error

type ContextCache

type ContextCache struct {
	sync.RWMutex
	Contexts map[string]*CollectorContext
	// contains filtered or unexported fields
}

func NewContextCache

func NewContextCache() *ContextCache

func (*ContextCache) AddMonitor

func (c *ContextCache) AddMonitor(event *events.MonitorCreated)

func (*ContextCache) DeleteMonitor

func (c *ContextCache) DeleteMonitor(event *events.MonitorRemoved)

func (*ContextCache) Emit

func (s *ContextCache) Emit(id string, event string, payload interface{})

func (*ContextCache) Refresh

func (c *ContextCache) Refresh(collectorId int64)

func (*ContextCache) RefreshLoop

func (c *ContextCache) RefreshLoop()

func (*ContextCache) Remove

func (s *ContextCache) Remove(id string)

func (*ContextCache) Set

func (s *ContextCache) Set(id string, context *CollectorContext)

func (*ContextCache) UpdateMonitor

func (c *ContextCache) UpdateMonitor(event *events.MonitorUpdated)

type NormalResponse

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

func ApiError

func ApiError(status int, message string, err error) *NormalResponse

func ApiSuccess

func ApiSuccess(message string) *NormalResponse

func Empty

func Empty(status int) *NormalResponse

func Json

func Json(status int, body interface{}) *NormalResponse

func Respond

func Respond(status int, body interface{}) *NormalResponse

func (*NormalResponse) Cache

func (r *NormalResponse) Cache(ttl string) *NormalResponse

func (*NormalResponse) Header

func (r *NormalResponse) Header(key, value string) *NormalResponse

func (*NormalResponse) WriteTo

func (r *NormalResponse) WriteTo(out http.ResponseWriter)

type Response

type Response interface {
	WriteTo(out http.ResponseWriter)
}

func AddCollector

func AddCollector(c *middleware.Context, cmd m.AddCollectorCommand) Response

func AddEndpoint

func AddEndpoint(c *middleware.Context, cmd m.AddEndpointCommand) Response

func AddMonitor

func AddMonitor(c *middleware.Context, cmd m.AddMonitorCommand) Response

func DeleteCollector

func DeleteCollector(c *middleware.Context) Response

func DeleteEndpoint

func DeleteEndpoint(c *middleware.Context) Response

func DeleteMonitor

func DeleteMonitor(c *middleware.Context) Response

func GetCollectorById

func GetCollectorById(c *middleware.Context) Response

func GetCollectors

func GetCollectors(c *middleware.Context, query m.GetCollectorsQuery) Response

func GetEndpointById

func GetEndpointById(c *middleware.Context) Response

func GetEndpoints

func GetEndpoints(c *middleware.Context, query m.GetEndpointsQuery) Response

func GetEvents

func GetEvents(c *middleware.Context, query m.GetEventsQuery) Response

func GetMonitorById

func GetMonitorById(c *middleware.Context) Response

func GetMonitorTypes

func GetMonitorTypes(c *middleware.Context) Response

func GetMonitors

func GetMonitors(c *middleware.Context, query m.GetMonitorsQuery) Response

func GetOrgQuotas

func GetOrgQuotas(c *middleware.Context) Response

func GetOwnOrgQuotas

func GetOwnOrgQuotas(c *middleware.Context) Response

func UpdateEndpoint

func UpdateEndpoint(c *middleware.Context, cmd m.UpdateEndpointCommand) Response

func UpdateMonitor

func UpdateMonitor(c *middleware.Context, cmd m.UpdateMonitorCommand) Response

func UpdateOrgQuota

func UpdateOrgQuota(c *middleware.Context, cmd m.UpdateOrgQuotaCmd) Response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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