Skip to content

Commit

Permalink
Merge pull request #9 from forrestjgq/dynamic-ctrl
Browse files Browse the repository at this point in the history
export api for enable/disable server
  • Loading branch information
forrestjgq authored Apr 29, 2022
2 parents 4af5d39 + bd2881d commit 078cca5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mark.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
package gomark

import (
"github.com/forrestjgq/glog"
"github.com/forrestjgq/gomark/gmi"
"github.com/forrestjgq/gomark/internal/gm"
"github.com/forrestjgq/gomark/internal/httpsrv"
"github.com/forrestjgq/glog"
)

// StartHTTPServer will create an http server for gomark.
Expand All @@ -37,6 +37,16 @@ func Request(req *gmi.Request) *gmi.Response {
return httpsrv.RequestHTTP(req)
}

// EnableServer will make server accept all marks
func EnableServer() {
gm.EnableServer()
}

// DisableServer will make server reject all marks
func DisableServer() {
gm.DisableServer()
}

// NewLatencyRecorder create a latency recorder.
func NewLatencyRecorder(name string) gmi.Marker {
var ret gmi.Marker
Expand Down

0 comments on commit 078cca5

Please sign in to comment.