Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultAllowRetryStatus() func(int) bool
- func DefaultTransientError(err error) bool
- func ExponentialBackoff(base time.Duration) backoffFunc
- func LinearBackoff(duration time.Duration) backoffFunc
- type GoQL
- type GoQLBuilder
- type GoQLClient
- type GoQLClientError
- type GoQLClientResponse
- type GoQLClientRunner
- type Query
- type Runner
- func (r *Runner) Debug() GoQLClientRunner
- func (r *Runner) RawReq() GoQLClientRunner
- func (r *Runner) RawRes() GoQLClientRunner
- func (r *Runner) RetryAllowStatus(fn func(int) bool) GoQLClientRunner
- func (r *Runner) RetryAttempts(count int) GoQLClientRunner
- func (r *Runner) RetryBackoff(backoff backoffFunc) GoQLClientRunner
- func (r *Runner) RetryOn(fn func(err error) bool) GoQLClientRunner
- func (r *Runner) Run(ctx context.Context) (GoQLClientResponse, *GoQLClientError)
- type Variables
Constants ¶
View Source
const Version = "1.0.0"
Version of current goql package
Variables ¶
View Source
var L *log.Logger
Functions ¶
func DefaultAllowRetryStatus ¶ added in v1.2.0
func DefaultTransientError ¶ added in v1.2.0
DefaultTransientError checks if the error is transient
func ExponentialBackoff ¶ added in v1.2.0
func LinearBackoff ¶ added in v1.2.0
Types ¶
type GoQL ¶
type GoQL struct {
// contains filtered or unexported fields
}
func (*GoQL) Mutation ¶
func (g *GoQL) Mutation(query Query) GoQLClientRunner
func (*GoQL) Query ¶
func (g *GoQL) Query(query Query) GoQLClientRunner
type GoQLBuilder ¶
type GoQLBuilder interface { SetURL(url string) GoQLBuilder SetHeader(name, value string) GoQLBuilder SetPayload(r io.Reader) GoQLBuilder SetMethod(method string) GoQLBuilder SetTimeout(seconds int) GoQLBuilder SetRetry(retryCount int) GoQLBuilder Build() GoQLClient }
func New ¶
func New() GoQLBuilder
type GoQLClient ¶
type GoQLClient interface { Query(q Query) GoQLClientRunner Mutation(m Query) GoQLClientRunner }
GoQLClient is an interface for a GraphQL HTTP client.
It provides two methods, `Query()` and `Mutation()`, for making GraphQL queries and mutations, respectively.
type GoQLClientError ¶ added in v1.2.0
type GoQLClientError struct { Description string // contains filtered or unexported fields }
type GoQLClientResponse ¶ added in v1.2.0
type GoQLClientResponse map[string]interface{}
type GoQLClientRunner ¶
type GoQLClientRunner interface { Run(ctx context.Context) (GoQLClientResponse, *GoQLClientError) Debug() GoQLClientRunner RawReq() GoQLClientRunner RawRes() GoQLClientRunner RetryAttempts(count int) GoQLClientRunner RetryBackoff(backoff backoffFunc) GoQLClientRunner RetryOn(fn func(err error) bool) GoQLClientRunner RetryAllowStatus(fn func(int) bool) GoQLClientRunner }
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) Debug ¶ added in v1.2.0
func (r *Runner) Debug() GoQLClientRunner
func (*Runner) RawReq ¶
func (r *Runner) RawReq() GoQLClientRunner
func (*Runner) RawRes ¶
func (r *Runner) RawRes() GoQLClientRunner
func (*Runner) RetryAllowStatus ¶ added in v1.2.0
func (r *Runner) RetryAllowStatus(fn func(int) bool) GoQLClientRunner
func (*Runner) RetryAttempts ¶ added in v1.2.0
func (r *Runner) RetryAttempts(count int) GoQLClientRunner
func (*Runner) RetryBackoff ¶ added in v1.2.0
func (r *Runner) RetryBackoff(backoff backoffFunc) GoQLClientRunner
func (*Runner) RetryOn ¶ added in v1.2.0
func (r *Runner) RetryOn(fn func(err error) bool) GoQLClientRunner
func (*Runner) Run ¶
func (r *Runner) Run(ctx context.Context) (GoQLClientResponse, *GoQLClientError)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.