Documentation
¶
Index ¶
- Constants
- Variables
- type BandwidthStartRequest
- type LatencyStartRequest
- type MetaMessage
- type PacketLossStartRequest
- type RESTApiV1
- func (a *RESTApiV1) BandwidthStart(resp http.ResponseWriter, req *http.Request)
- func (a *RESTApiV1) BandwidthStatus(resp http.ResponseWriter, _ *http.Request)
- func (a *RESTApiV1) BandwidthStop(resp http.ResponseWriter, req *http.Request)
- func (a *RESTApiV1) GetAllAPIs() []string
- func (a *RESTApiV1) IndexPage(resp http.ResponseWriter, _ *http.Request)
- func (a *RESTApiV1) LatencyStart(resp http.ResponseWriter, req *http.Request)
- func (a *RESTApiV1) LatencyStatus(resp http.ResponseWriter, _ *http.Request)
- func (a *RESTApiV1) LatencyStop(resp http.ResponseWriter, req *http.Request)
- func (a *RESTApiV1) NetServicesStatus(resp http.ResponseWriter, req *http.Request)
- func (a *RESTApiV1) PacketlossStart(resp http.ResponseWriter, req *http.Request)
- func (a *RESTApiV1) PacketlossStatus(resp http.ResponseWriter, _ *http.Request)
- func (a *RESTApiV1) PacketlossStop(resp http.ResponseWriter, req *http.Request)
- func (a *RESTApiV1) Serve(addr, originAllowed string) error
- func (a *RESTApiV1) Shutdown() error
- type ServiceStatus
Constants ¶
View Source
const ( APIMetaMessageTypeInfo = "info" APIMetaMessageTypeWarning = "warning" APIMetaMessageTypeError = "error" )
View Source
const ( SlugServiceAlreadyStarted = "service-already-started" SlugServiceStartFailed = "service-start-failed" SlugServiceStopFailed = "service-stop-failed" SlugServiceNotStarted = "service-not-started" SlugServiceNotInitialized = "service-not-initialized" SlugServiceReady = "service-ready" SlugServiceNotReady = "service-not-ready" SlugServiceSetParamFailed = "service-set-param-failed" SlugJSONDecodeFailed = "json-decode-failed" SlugTypeError = "type-error" )
View Source
const ServiceStopTimeout = 5 // Seconds
Variables ¶
View Source
var ( PacketlossPath = &serviceEndpointPath{basePath: "/packetloss"} BandwidthPath = &serviceEndpointPath{basePath: "/bandwidth"} LatencyPath = &serviceEndpointPath{basePath: "/latency"} ServicesPath = &serviceEndpointPath{basePath: "/services"} )
View Source
var ( ErrServiceNotInitialized = errors.New(SlugServiceNotInitialized) ErrServiceAlreadyStarted = errors.New(SlugServiceAlreadyStarted) ErrServiceNotStarted = errors.New(SlugServiceNotStarted) ErrServiceStopFailed = errors.New(SlugServiceStopFailed) ErrServiceStartFailed = errors.New(SlugServiceStartFailed) )
Functions ¶
This section is empty.
Types ¶
type BandwidthStartRequest ¶
type LatencyStartRequest ¶
type MetaMessage ¶
type MetaMessage struct { Type string `json:"type"` // info, warning, error Slug string `json:"slug"` Title string `json:"title"` Message string `json:"message"` }
func (MetaMessage) ToMap ¶
func (m MetaMessage) ToMap() map[string]interface{}
convert a ApiMetaMessage to map[string]interface{}
type PacketLossStartRequest ¶
type RESTApiV1 ¶
type RESTApiV1 struct {
// contains filtered or unexported fields
}
func (*RESTApiV1) BandwidthStart ¶
func (a *RESTApiV1) BandwidthStart(resp http.ResponseWriter, req *http.Request)
BandwidthStart implements POST /bandwidth/start
func (*RESTApiV1) BandwidthStatus ¶
func (a *RESTApiV1) BandwidthStatus(resp http.ResponseWriter, _ *http.Request)
BandwidthStatus implements GET /bandwidth/status
func (*RESTApiV1) BandwidthStop ¶
func (a *RESTApiV1) BandwidthStop(resp http.ResponseWriter, req *http.Request)
BandwidthStop implements POST /bandwidth/stop
func (*RESTApiV1) GetAllAPIs ¶
func (*RESTApiV1) IndexPage ¶
func (a *RESTApiV1) IndexPage(resp http.ResponseWriter, _ *http.Request)
IndexPage implements GET /
func (*RESTApiV1) LatencyStart ¶
func (a *RESTApiV1) LatencyStart(resp http.ResponseWriter, req *http.Request)
LatencyStart implements POST /latency/start
func (*RESTApiV1) LatencyStatus ¶
func (a *RESTApiV1) LatencyStatus(resp http.ResponseWriter, _ *http.Request)
LatencyStatus implements GET /latency/status
func (*RESTApiV1) LatencyStop ¶
func (a *RESTApiV1) LatencyStop(resp http.ResponseWriter, req *http.Request)
LatencyStop implements POST /latency/stop
func (*RESTApiV1) NetServicesStatus ¶
func (a *RESTApiV1) NetServicesStatus(resp http.ResponseWriter, req *http.Request)
NetServicesStatus implements GET /services/status
func (*RESTApiV1) PacketlossStart ¶
func (a *RESTApiV1) PacketlossStart(resp http.ResponseWriter, req *http.Request)
PacketlossStart implements POST /packetloss/start
func (*RESTApiV1) PacketlossStatus ¶
func (a *RESTApiV1) PacketlossStatus(resp http.ResponseWriter, _ *http.Request)
PacketlossStatus implements GET /packetloss/status
func (*RESTApiV1) PacketlossStop ¶
func (a *RESTApiV1) PacketlossStop(resp http.ResponseWriter, req *http.Request)
PacketlossStop implements POST /packetloss/stop
Click to show internal directories.
Click to hide internal directories.