Documentation
¶
Index ¶
- Constants
- Variables
- func GetSchema() *introspection.Schema
- func Introspect(ctx context.Context, r *router.Router) (*introspection.Schema, error)
- func IntrospectAndGenerate(ctx context.Context, r *router.Router, generator Generator) ([]byte, error)
- func SetSchema(schema *introspection.Schema)
- func SetSchemaParents(schema *introspection.Schema)
- type CommonFunctions
- type Config
- type FormatTypeFuncs
- type Generator
- type SDKLang
Constants ¶
View Source
const ( QueryStructName = "Query" QueryStructClientName = "Client" )
Variables ¶
View Source
var CustomScalar = map[string]string{
"ContainerID": "Container",
"FileID": "File",
"DirectoryID": "Directory",
"SecretID": "Secret",
"SocketID": "Socket",
"CacheID": "CacheVolume",
}
CustomScalar registers custom Dagger type. TODO: This may done it dynamically later instead of a static map.
View Source
var ErrUnknownSDKLang = errors.New("unknown sdk language")
Functions ¶
func GetSchema ¶ added in v0.4.2
func GetSchema() *introspection.Schema
func Introspect ¶ added in v0.3.5
Introspect get the Dagger Schema with the router r.
func IntrospectAndGenerate ¶
func IntrospectAndGenerate(ctx context.Context, r *router.Router, generator Generator) ([]byte, error)
IntrospectAndGenerate generate the Dagger API with the router r.
func SetSchema ¶ added in v0.4.2
func SetSchema(schema *introspection.Schema)
func SetSchemaParents ¶ added in v0.3.5
func SetSchemaParents(schema *introspection.Schema)
SetSchemaParents sets all the parents for the fields.
Types ¶
type CommonFunctions ¶ added in v0.3.12
type CommonFunctions struct {
// contains filtered or unexported fields
}
CommonFunctions formatting function with global shared template functions.
func NewCommonFunctions ¶ added in v0.3.12
func NewCommonFunctions(formatTypeFuncs FormatTypeFuncs) *CommonFunctions
func (*CommonFunctions) FormatInputType ¶ added in v0.3.12
func (c *CommonFunctions) FormatInputType(r *introspection.TypeRef) string
FormatInputType formats a GraphQL type into the SDK language input
Example: `String` -> `string`
func (*CommonFunctions) FormatOutputType ¶ added in v0.3.12
func (c *CommonFunctions) FormatOutputType(r *introspection.TypeRef) string
FormatOutputType formats a GraphQL type into the SDK language output
Example: `String` -> `string`
type FormatTypeFuncs ¶ added in v0.3.12
type FormatTypeFuncs interface { FormatKindList(representation string) string FormatKindScalarString(representation string) string FormatKindScalarInt(representation string) string FormatKindScalarFloat(representation string) string FormatKindScalarBoolean(representation string) string FormatKindScalarDefault(representation string, refName string, input bool) string FormatKindObject(representation string, refName string) string FormatKindInputObject(representation string, refName string) string FormatKindEnum(representation string, refName string) string }
FormatTypeFuncs is an interface to format any GraphQL type. Each generator has to implement this interface.
Click to show internal directories.
Click to hide internal directories.