Add management of the retries via headers.

This commit is contained in:
2023-04-10 03:12:39 +01:00
parent a7b385f0b7
commit 21c9119bcb
8 changed files with 95 additions and 153 deletions
+19 -20
View File
@@ -5,7 +5,6 @@ import (
"net/http"
"github.com/akyoto/cache"
"github.com/lukaszraczylo/go-simple-graphql/utils/concurrency"
"github.com/lukaszraczylo/go-simple-graphql/utils/logger"
)
@@ -22,18 +21,17 @@ type retriesConfig struct {
}
type BaseClient struct {
Logger Logger
LoggerWriter Writer
client *http.Client
concurrencyManager *concurrency.Pool
endpoint string
responseType string
cache cacheStore
MaxGoRoutines int
LoggingLevel logger.LogLevel
LoggerColorful bool
validate bool
retries retriesConfig
Logger Logger
LoggerWriter Writer
client *http.Client
endpoint string
responseType string
cache cacheStore
MaxGoRoutines int
LoggingLevel logger.LogLevel
LoggerColorful bool
validate bool
retries retriesConfig
}
type Query struct {
@@ -44,13 +42,14 @@ type Query struct {
}
type queryExecutor struct {
result queryExecutorResult
context context.Context
client *BaseClient
headers map[string]interface{}
hash string
query []byte
should_cache bool
result queryExecutorResult
context context.Context
client *BaseClient
headers map[string]interface{}
hash string
query []byte
should_cache bool
retries_enabled bool
}
type queryExecutorResult struct {