config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config handles loading and validating structql configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Schema       []string                `yaml:"schema"`
	Queries      string                  `yaml:"queries"`
	Output       string                  `yaml:"output"`
	Package      string                  `yaml:"package"`
	Scalars      map[string]ScalarConfig `yaml:"scalars,omitempty"`
	TypeMappings map[string]string       `yaml:"type_mappings,omitempty"`
	Prefix       string                  `yaml:"prefix,omitempty"`
	// contains filtered or unexported fields
}

Config represents the structql configuration file.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with sensible defaults for scaffolding.

func Load

func Load(path string) (*Config, error)

Load reads and parses a config file, resolving paths relative to the config file location.

func (*Config) Marshal

func (c *Config) Marshal() ([]byte, error)

Marshal serializes the config to YAML bytes.

type ScalarConfig

type ScalarConfig struct {
	Type   string `yaml:"type"`
	Import string `yaml:"import,omitempty"`
}

ScalarConfig defines how a custom GraphQL scalar maps to a Go type.

Jump to

Keyboard shortcuts

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