Documentation
¶
Index ¶
- type ApiService
- func (r *ApiService) Delete(path string, query map[string]any) (*response.Response, error)
- func (r *ApiService) Get(path string, query map[string]any) (*response.Response, error)
- func (r *ApiService) Post(path string, data map[string]any) (*response.Response, error)
- func (r *ApiService) Put(path string, data map[string]any) (*response.Response, error)
- func (r *ApiService) ToCurl() string
- func (r *ApiService) WithAttachment(name string, contents []byte, filename string) *ApiService
- func (r *ApiService) WithHeader(headers map[string]string) *ApiService
- func (r *ApiService) WithToken(token string) *ApiService
- type Attachment
- type CdnService
- type GraphQLError
- type GraphQLResponse
- type GraphQLService
- func (g *GraphQLService) Mutation(mutation string) error
- func (g *GraphQLService) Query(query string) error
- func (g *GraphQLService) QueryWithContext(ctx context.Context, query string) error
- func (g *GraphQLService) Subscribe(subscription string, callback func(model any)) error
- func (g *GraphQLService) Unsubscribe() error
- func (g *GraphQLService) WithHeader(headers map[string]string) *GraphQLService
- func (g *GraphQLService) WithToken(token string) *GraphQLService
- func (g *GraphQLService) WithVariables(vars map[string]any) *GraphQLService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiService ¶
type ApiService struct {
// contains filtered or unexported fields
}
func (*ApiService) ToCurl ¶
func (r *ApiService) ToCurl() string
ToCurl returns the curl command representation of the request
func (*ApiService) WithAttachment ¶
func (r *ApiService) WithAttachment(name string, contents []byte, filename string) *ApiService
func (*ApiService) WithHeader ¶
func (r *ApiService) WithHeader(headers map[string]string) *ApiService
func (*ApiService) WithToken ¶
func (r *ApiService) WithToken(token string) *ApiService
type Attachment ¶
type CdnService ¶
type CdnService struct{}
type GraphQLError ¶ added in v1.3.4
type GraphQLResponse ¶ added in v1.3.4
type GraphQLResponse struct { Data any `json:"data"` Errors []GraphQLError `json:"errors"` }
type GraphQLService ¶ added in v1.3.4
type GraphQLService struct {
// contains filtered or unexported fields
}
func NewGql ¶ added in v1.3.4
func NewGql(model any) *GraphQLService
New creates a new GraphQLService instance
func (*GraphQLService) Mutation ¶ added in v1.3.4
func (g *GraphQLService) Mutation(mutation string) error
Mutation executes a GraphQL mutation
func (*GraphQLService) Query ¶ added in v1.3.4
func (g *GraphQLService) Query(query string) error
Query executes a GraphQL query
func (*GraphQLService) QueryWithContext ¶ added in v1.3.4
func (g *GraphQLService) QueryWithContext(ctx context.Context, query string) error
QueryWithContext executes a GraphQL query with context
func (*GraphQLService) Subscribe ¶ added in v1.3.4
func (g *GraphQLService) Subscribe(subscription string, callback func(model any)) error
Subscribe creates a WebSocket connection and subscribes to a GraphQL subscription
func (*GraphQLService) Unsubscribe ¶ added in v1.3.4
func (g *GraphQLService) Unsubscribe() error
Unsubscribe closes the WebSocket connection
func (*GraphQLService) WithHeader ¶ added in v1.3.4
func (g *GraphQLService) WithHeader(headers map[string]string) *GraphQLService
WithHeader adds headers to the request
func (*GraphQLService) WithToken ¶ added in v1.3.4
func (g *GraphQLService) WithToken(token string) *GraphQLService
WithToken adds authorization token to headers
func (*GraphQLService) WithVariables ¶ added in v1.3.4
func (g *GraphQLService) WithVariables(vars map[string]any) *GraphQLService
WithVariables adds variables to the GraphQL query
Click to show internal directories.
Click to hide internal directories.