Skip to content

Commit

Permalink
Merge pull request #2 from armosec/middleware
Browse files Browse the repository at this point in the history
Add get port
  • Loading branch information
avrahams authored Feb 26, 2023
2 parents fa4e9c7 + 7fdacb9 commit 1c361a9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const localHost = "127.0.0.1"
type TestServer interface {
//get server URL and port
GetURL() string
//get server port
GetPort() int
//get server port as string
GetPortAsString() string
//get the current number of requests received by the server
GetRequestCount() int
//SetOption sets a new option to the server, error is return if the option cannot be modified
Expand Down Expand Up @@ -60,6 +64,14 @@ func (ts *mockTestingServer) GetURL() string {
return fmt.Sprintf("http://%s:%d", localHost, ts.options.port)
}

func (ts *mockTestingServer) GetPort() int {
return ts.options.port
}

func (ts *mockTestingServer) GetPortAsString() string {
return fmt.Sprintf("%d", ts.options.port)
}

func (ts *mockTestingServer) SetOption(opt ServerOption) error {
ts.mux.Lock()
defer ts.mux.Unlock()
Expand Down

0 comments on commit 1c361a9

Please sign in to comment.