Files
go-simple-graphql/structs.go
lukaszraczyloandGitHub 36ef16ad3d general improvements (#2)
* Replaced strutil.Md5 with crypto/md5 and encoding/hex to reduce dependency and potential allocations.

* Move to improved logging library.

* fixup! Move to improved logging library.
2024-06-28 09:22:52 +01:00

47 lines
966 B
Go

package gql
import (
"net/http"
"time"
cache "github.com/lukaszraczylo/go-simple-graphql/cache"
logging "github.com/lukaszraczylo/go-simple-graphql/logging"
)
type BaseClient struct {
cache *cache.Cache
Logger *logging.Logger
client *http.Client
endpoint string
responseType string
retries_delay time.Duration
retries_number int
MaxGoRoutines int
cache_global bool
retries_enable bool
}
type Query struct {
Variables map[string]interface{} `json:"variables,omitempty"`
Query string `json:"query,omitempty"`
JsonQuery []byte `json:"jsonQuery,omitempty"`
}
type QueryExecutor struct {
Result any
Error error
*BaseClient
Headers map[string]interface{}
CacheKey string
Query []byte
CacheTTL time.Duration
Retries bool
}
type queryResults struct {
Data interface{} `json:"data"`
Errors []struct {
Message interface{} `json:"message"`
} `json:"errors"`
}