...
1 package errorlog
2
3 import (
4 "github.com/vektah/gqlparser/v2/gqlerror"
5 )
6
7 type Option func(a *Provider)
8
9 func WithInput(input string) Option {
10 return func(a *Provider) {
11 a.input = input
12 }
13 }
14
15 func WithErrors(errs gqlerror.List) Option {
16 return func(a *Provider) {
17 if errs.Error() != "" {
18 err := errs.Error()
19 a.err = &err
20 }
21 }
22 }
23
24 func WithCorrelationID(correlationID string) Option {
25 return func(a *Provider) {
26 a.correlationID = correlationID
27 }
28 }
29
View as plain text