fix_: linter and some more
This commit is contained in:
parent
6696e6fb9e
commit
46ce050d39
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
|
||||
"github.com/status-im/status-go/cmd/statusd/server"
|
||||
|
@ -13,7 +14,6 @@ var (
|
|||
)
|
||||
|
||||
func main() {
|
||||
|
||||
srv := server.NewServer()
|
||||
srv.Setup()
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package server
|
||||
|
||||
import "github.com/status-im/status-go/mobile"
|
||||
import statusgo "github.com/status-im/status-go/mobile"
|
||||
|
||||
var EndpointsWithResponse = []func(string) string{
|
||||
statusgo.InitializeApplication,
|
||||
|
@ -93,6 +93,7 @@ var EndpointsUnsupported = []string {
|
|||
"ConvertToKeycardAccount",
|
||||
"ConvertToRegularAccount",
|
||||
"SwitchFleet",
|
||||
"GenerateImages",
|
||||
"InputConnectionStringForBootstrapping",
|
||||
"InputConnectionStringForBootstrappingAnotherDevice",
|
||||
"InputConnectionStringForImportingKeypairsKeystores",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package server
|
||||
|
||||
import "github.com/status-im/status-go/mobile"
|
||||
import statusgo "github.com/status-im/status-go/mobile"
|
||||
|
||||
var EndpointsWithResponse = []func(string) string{
|
||||
{{- range .FunctionsWithResp }}
|
||||
|
|
|
@ -126,7 +126,7 @@ func (s *Server) signals(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func (s *Server) addEndpointWithResponse(handler func(string) string) {
|
||||
endpoint := endpointName(functionName(handler))
|
||||
log.Info("adding endpoint", "name", endpoint)
|
||||
log.Debug("adding endpoint", "name", endpoint)
|
||||
s.mux.HandleFunc(endpoint, func(w http.ResponseWriter, r *http.Request) {
|
||||
request, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
|
@ -145,7 +145,7 @@ func (s *Server) addEndpointWithResponse(handler func(string) string) {
|
|||
|
||||
func (s *Server) addEndpointNoRequest(handler func() string) {
|
||||
endpoint := endpointName(functionName(handler))
|
||||
log.Info("adding endpoint", "name", endpoint)
|
||||
log.Debug("adding endpoint", "name", endpoint)
|
||||
s.mux.HandleFunc(endpoint, func(w http.ResponseWriter, r *http.Request) {
|
||||
response := handler()
|
||||
|
||||
|
@ -158,7 +158,7 @@ func (s *Server) addEndpointNoRequest(handler func() string) {
|
|||
|
||||
func (s *Server) addUnsupportedEndpoint(name string) {
|
||||
endpoint := endpointName(name)
|
||||
log.Info("marking unsupported endpoint", "name", endpoint)
|
||||
log.Debug("marking unsupported endpoint", "name", endpoint)
|
||||
s.mux.HandleFunc(endpoint, func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusNotImplemented)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue