Files
go-simple-graphql/structs.go
T
lukaszraczylo e0913f8824 New minor release after complete rewrite.
Brings neat and testable codebase with minimum allocations in mind.
2023-04-07 15:27:44 +01:00

51 lines
1.0 KiB
Go

package gql
import (
"context"
"net/http"
"github.com/lukaszraczylo/go-simple-graphql/utils/concurrency"
"github.com/lukaszraczylo/go-simple-graphql/utils/logger"
"github.com/allegro/bigcache"
)
type cacheStore struct {
client *bigcache.BigCache
ttl int
enabled bool
}
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
}
type Query struct {
context context.Context
variables map[string]any `json:"variables"`
query string `json:"query"`
compiledQuery []byte `json:"compiledQuery"`
}
type request struct {
Variables any `json:"variables"`
Query string `json:"query"`
}
type queryResults struct {
Data interface{} `json:"data"`
Errors []struct {
Message interface{} `json:"message"`
} `json:"errors"`
}