-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructs.go
46 lines (40 loc) · 966 Bytes
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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"`
}