actions

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryTemplate = `` /* 226-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func BuildArgVarsList

func BuildArgVarsList(args map[string]string) string

func BuildArgsList

func BuildArgsList(args map[string]string) string

func BuildRequest

func BuildRequest(payload io.Reader, endpoint string, authClient auth.AuthClient) (*http.Request, error)

BuildRequest builds the request and it sets the headers

func JsonMarshalToString added in v0.2.0

func JsonMarshalToString(v interface{}) (string, error)

Types

type GraphQLQuery

type GraphQLQuery struct {
	Type      QueryType
	QueryName string
	Args      map[string]string
	Returns   []string
}

type QueryType

type QueryType string
const (
	QueryTypeQuery    QueryType = "query"
	QueryTypeMutation QueryType = "mutation"
)

type RequestBodyError

type RequestBodyError interface {
	error
}

RequestBodyError is returned by BuildRequestBody for any error

func BuildRequestBody

func BuildRequestBody(requestTemplate string, vars interface{}, funcs template.FuncMap) (io.Reader, RequestBodyError)

BuildRequestBody takes the request(query)-specific variables template in and uses it to overlay the common QueryTemplate using the supplied variables, then returns an io.Reader for use as a GraphQL http request body. The user can supply additional functions for use during template processing, but for most queries it should be safe to pass nil and rely on the predefined template.FuncMap.

NOTE: The supplied template *must* include an inlined template definition for "vars", e.g.: `{{define "vars"}}"var_1":"{{.Var1}},"var2":"{{.Var2}}"{{end}}`

Directories

Path Synopsis
channelsfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
clustersfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
groupsfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
resourcesfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
subscriptionsfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
usersfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
versionsfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL