Unverified Commit 4bf4c193 authored by Flávio Fernandes's avatar Flávio Fernandes Committed by GitHub
Browse files

Improve satori client (#1065)

parent eff9544a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ require (
	github.com/gorilla/mux v1.8.0
	github.com/gorilla/websocket v1.5.0
	github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0
	github.com/heroiclabs/nakama-common v1.28.0
	github.com/heroiclabs/nakama-common v1.28.1-0.20230731105719-fb1172396380
	github.com/jackc/pgconn v1.14.0
	github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa
	github.com/jackc/pgtype v1.14.0
+2 −0
+14 −0
Original line number Diff line number Diff line
@@ -161,6 +161,8 @@ func (s *SatoriClient) Authenticate(ctx context.Context, id string) error {
		return err
	}

	defer res.Body.Close()

	switch res.StatusCode {
	case 200:
		return nil
@@ -198,6 +200,8 @@ func (s *SatoriClient) PropertiesGet(ctx context.Context, id string) (*runtime.P
		return nil, err
	}

	defer res.Body.Close()

	switch res.StatusCode {
	case 200:
		resBody, err := io.ReadAll(res.Body)
@@ -251,6 +255,8 @@ func (s *SatoriClient) PropertiesUpdate(ctx context.Context, id string, properti
		return err
	}

	defer res.Body.Close()

	switch res.StatusCode {
	case 200:
		return nil
@@ -315,6 +321,8 @@ func (s *SatoriClient) EventsPublish(ctx context.Context, id string, events []*r
		return err
	}

	defer res.Body.Close()

	switch res.StatusCode {
	case 200:
		return nil
@@ -361,6 +369,8 @@ func (s *SatoriClient) ExperimentsList(ctx context.Context, id string, names ...
		return nil, err
	}

	defer res.Body.Close()

	switch res.StatusCode {
	case 200:
		resBody, err := io.ReadAll(res.Body)
@@ -417,6 +427,8 @@ func (s *SatoriClient) FlagsList(ctx context.Context, id string, names ...string
		return nil, err
	}

	defer res.Body.Close()

	switch res.StatusCode {
	case 200:
		resBody, err := io.ReadAll(res.Body)
@@ -473,6 +485,8 @@ func (s *SatoriClient) LiveEventsList(ctx context.Context, id string, names ...s
		return nil, err
	}

	defer res.Body.Close()

	switch res.StatusCode {
	case 200:
		resBody, err := io.ReadAll(res.Body)
+2 −2
Original line number Diff line number Diff line
@@ -1210,6 +1210,6 @@ type LiveEvent struct {
	Name               string `json:"name,omitempty"`
	Description        string `json:"description,omitempty"`
	Value              string `json:"value,omitempty"`
	ActiveStartTimeSec int64  `json:"active_start_time_sec,omitempty"`
	ActiveEndTimeSec   int64  `json:"active_end_time_sec,omitempty"`
	ActiveStartTimeSec int64  `json:"active_start_time_sec,string,omitempty"`
	ActiveEndTimeSec   int64  `json:"active_end_time_sec,string,omitempty"`
}
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/internal/genopena
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options
github.com/grpc-ecosystem/grpc-gateway/v2/runtime
github.com/grpc-ecosystem/grpc-gateway/v2/utilities
# github.com/heroiclabs/nakama-common v1.28.0
# github.com/heroiclabs/nakama-common v1.28.1-0.20230731105719-fb1172396380
## explicit; go 1.19
github.com/heroiclabs/nakama-common/api
github.com/heroiclabs/nakama-common/rtapi