Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used for making GraphQL requests via HTTP using pre-configured url, query, header and login information.
Client is thread-safe.
func (*Client) Do ¶
Do sends the GraphQL request using the configured query and the provided variables.
For successful requests it will return the response body and no error. For unsuccessful requests it will return an error and if possible the response body.
If the client was configured with OAuth credentials, it will follow a client_credentials flow to receive a valid authorization token. The token will automatically be renewed before its expiry.
For any authorization other flow you can provide the required authorization headers during client creation.
type Config ¶
type Config struct { URL string Connections int Verbose bool Headers []string BearerToken string OAuth OAuthConfig QueryFile string InputFile string OutputFile string ErrorFile string }
Config holds the run configuration.
type OAuthConfig ¶
OAuthConfig holds the credentials for the OAuth 2.0 client credentials flow.
type SilentStats ¶
type SilentStats struct{}
SilentStats can be used when the statistics should not be collected.
func (*SilentStats) Values ¶
func (s *SilentStats) Values() (int, int)
Values always returns zero for the counter values.
type VerboseStats ¶
type VerboseStats struct {
// contains filtered or unexported fields
}
VerboseStats counts the processed and erroneous requests.
VerboseStats is thread-safe with regards to incrementing the counter values.
func (*VerboseStats) AddError ¶
func (s *VerboseStats) AddError()
AddError increases the erroneous requests counter by one.
func (*VerboseStats) AddProcessed ¶
func (s *VerboseStats) AddProcessed()
AddProcessed increases the processed requests counter by one.
func (*VerboseStats) Values ¶
func (s *VerboseStats) Values() (int, int)
Values returns the current counter values (processed and erroneous requests).
Values does not lock the counters while reading them, potentially resulting in situations where each counter value is correct at the time it was read, but not correct when looking at both values.