Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultAPIKeyEnv = "TUTONE_API_KEY" DefaultSchemaCacheFile = "schema.json" )
View Source
const ( DefaultHTTPTimeout = 30 * time.Second DefaultAuthHeader = "Api-Key" )
Variables ¶
View Source
var Command = &cobra.Command{ Use: "fetch", Short: "Fetch GraphQL Schema", Long: `Fetch GraphQL Schema Query the GraphQL server for schema and write it to a file. `, Example: "tutone fetch --config configs/tutone.yaml", Run: func(cmd *cobra.Command, args []string) { Fetch( viper.GetString("endpoint"), viper.GetBool("auth.disable"), viper.GetString("auth.header"), viper.GetString("auth.api_key_env_var"), viper.GetString("cache.schema_file"), refetch, ) }, }
Functions ¶
Types ¶
type AuthConfig ¶
type Endpoint ¶
type Endpoint struct { URL string Auth AuthConfig HTTP HTTPConfig }
func NewEndpoint ¶
func NewEndpoint() *Endpoint
func (*Endpoint) Fetch ¶
Fetch returns everything we know how to get about the schema of an endpoint
func (*Endpoint) FetchSchema ¶
FetchSchema returns basic info about the schema
func (*Endpoint) FetchSchemaTypes ¶
FetchTypes gathers all of the data types in the schema
type GraphqlQuery ¶
type GraphqlQuery struct { Query string `json:"query"` Variables interface{} `json:"variables"` // map[string]interface really... }
type HTTPConfig ¶
Click to show internal directories.
Click to hide internal directories.