diff options
| author | Shulhan <ms@kilabit.info> | 2024-03-15 13:58:56 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-03-15 13:58:56 +0700 |
| commit | 8ba25dd9f5d823a4bd66967b33ee9d2624397129 (patch) | |
| tree | 840b555620baf86b70f92f9553741a5ac39654eb /http_server.go | |
| parent | cb9e9ecf8466386621954acdafc460ecd0c3f82f (diff) | |
| download | gorankusu-8ba25dd9f5d823a4bd66967b33ee9d2624397129.tar.xz | |
all: update module pakakeh.go to the tip
Diffstat (limited to 'http_server.go')
| -rw-r--r-- | http_server.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/http_server.go b/http_server.go index 94dfaf2..cac1363 100644 --- a/http_server.go +++ b/http_server.go @@ -32,7 +32,7 @@ const ( // List of HTTP APIs provided by Gorankusu HTTP server. var ( - apiEnvironmentGet = &libhttp.Endpoint{ + apiEnvironmentGet = libhttp.Endpoint{ Method: libhttp.RequestMethodGet, Path: pathAPIEnvironment, RequestType: libhttp.RequestTypeJSON, @@ -52,40 +52,40 @@ var ( ResponseType: libhttp.ResponseTypeJSON, } - apiAttackResultDelete = &libhttp.Endpoint{ + apiAttackResultDelete = libhttp.Endpoint{ Method: libhttp.RequestMethodDelete, Path: pathAPIAttackResult, RequestType: libhttp.RequestTypeJSON, ResponseType: libhttp.ResponseTypeJSON, } - apiAttackResultGet = &libhttp.Endpoint{ + apiAttackResultGet = libhttp.Endpoint{ Method: libhttp.RequestMethodGet, Path: pathAPIAttackResult, RequestType: libhttp.RequestTypeQuery, ResponseType: libhttp.ResponseTypeJSON, } - apiNavLinks = &libhttp.Endpoint{ + apiNavLinks = libhttp.Endpoint{ Method: libhttp.RequestMethodGet, Path: pathAPINavlinks, RequestType: libhttp.RequestTypeNone, ResponseType: libhttp.ResponseTypeJSON, } - apiTargetRunHTTP = &libhttp.Endpoint{ + apiTargetRunHTTP = libhttp.Endpoint{ Method: libhttp.RequestMethodPost, Path: pathAPITargetRunHTTP, RequestType: libhttp.RequestTypeJSON, ResponseType: libhttp.ResponseTypeJSON, } - apiTargetRunWebSocket = &libhttp.Endpoint{ + apiTargetRunWebSocket = libhttp.Endpoint{ Method: libhttp.RequestMethodPost, Path: pathAPITargetRunWebSocket, RequestType: libhttp.RequestTypeJSON, ResponseType: libhttp.ResponseTypeJSON, } - apiTargets = &libhttp.Endpoint{ + apiTargets = libhttp.Endpoint{ Method: libhttp.RequestMethodGet, Path: pathAPITargets, RequestType: libhttp.RequestTypeNone, @@ -112,7 +112,7 @@ func (gorankusu *Gorankusu) initHTTPServer(isDevelopment bool) (err error) { memfsWWW.Opts.TryDirect = isDevelopment } - httpdOpts := &libhttp.ServerOptions{ + var httpdOpts = libhttp.ServerOptions{ Memfs: memfsWWW, Address: gorankusu.Env.ListenAddress, } @@ -129,13 +129,13 @@ func (gorankusu *Gorankusu) initHTTPServer(isDevelopment bool) (err error) { } apiAttackHTTP.Call = gorankusu.apiAttackHTTP - err = gorankusu.Httpd.RegisterEndpoint(&apiAttackHTTP) + err = gorankusu.Httpd.RegisterEndpoint(apiAttackHTTP) if err != nil { return fmt.Errorf(`%s: %w`, logp, err) } apiAttackHTTPCancel.Call = gorankusu.apiAttackHTTPCancel - err = gorankusu.Httpd.RegisterEndpoint(&apiAttackHTTPCancel) + err = gorankusu.Httpd.RegisterEndpoint(apiAttackHTTPCancel) if err != nil { return fmt.Errorf(`%s: %w`, logp, err) } |
