Skip to content

Commit

Permalink
export api for enable/disable server
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestjgq committed Apr 29, 2022
1 parent e2b9b90 commit bd2881d
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 bd2881d

Please sign in to comment.