Documentation
¶
Index ¶
- Constants
- func ConfigFilenames() []string
- func IsConfigFilename(filename string) bool
- func MarshalModuleConfigForFilename(modCfg *ModuleConfigWithUserFields, filename string) ([]byte, error)
- func MarshalModuleConfigForFormat(modCfg *ModuleConfigWithUserFields, format ConfigFormat) ([]byte, error)
- type ConfigFormat
- type CurrentModuleConfig
- type CurrentModuleConfigDependency
- type CurrentModuleConfigWithUserFields
- type LegacyModuleConfigWithUserFields
- type ModuleCodegenConfig
- type ModuleConfig
- type ModuleConfigArgument
- type ModuleConfigClient
- type ModuleConfigDependency
- type ModuleConfigUserFields
- type ModuleConfigView
- type ModuleConfigWithUserFields
- type SDK
Constants ¶
const EngineVersionLatest string = "latest"
EngineVersionLatest is replaced by the current engine.Version during module init.
const Filename = "dagger-module.toml"
Filename is the name of the current module config file.
const LegacyFilename = "dagger.json"
LegacyFilename is the legacy module config file name.
Variables ¶
This section is empty.
Functions ¶
func ConfigFilenames ¶
func ConfigFilenames() []string
func IsConfigFilename ¶
func MarshalModuleConfigForFilename ¶
func MarshalModuleConfigForFilename(modCfg *ModuleConfigWithUserFields, filename string) ([]byte, error)
func MarshalModuleConfigForFormat ¶
func MarshalModuleConfigForFormat(modCfg *ModuleConfigWithUserFields, format ConfigFormat) ([]byte, error)
Types ¶
type ConfigFormat ¶
type ConfigFormat string
ConfigFormat identifies the field layout for a module config file.
const ( ConfigFormatCurrent ConfigFormat = "current" ConfigFormatLegacy ConfigFormat = "legacy" )
func ConfigFormatForFilename ¶
func ConfigFormatForFilename(filename string) ConfigFormat
type CurrentModuleConfig ¶
type CurrentModuleConfig struct {
// The name of the module.
Name string `json:"name" toml:"name"`
// The version of the engine this module was last updated with.
EngineVersion string `json:"engineVersion" toml:"engineVersion"`
// Paths to explicitly include from the module, relative to the configuration file.
Include []string `json:"include,omitempty" toml:"include,omitempty"`
// The path, relative to this config file, to the subdir containing the module's implementation source code.
Source string `json:"source,omitempty" toml:"source,omitempty"`
// Paths to explicitly exclude from the module, relative to the configuration file.
//
// Deprecated: Use !<pattern> in the include list instead.
Exclude []string `json:"exclude,omitempty" toml:"exclude,omitempty"`
// If true, disable the new default function caching behavior for this module. Functions will
// instead default to the old behavior of per-session caching.
DisableDefaultFunctionCaching *bool `json:"disableDefaultFunctionCaching,omitempty" toml:"disableDefaultFunctionCaching,omitempty"`
// The runtime this module uses.
Runtime *SDK `json:"runtime,omitempty" toml:"runtime,omitempty"`
// The modules this module depends on.
Dependencies []*CurrentModuleConfigDependency `json:"dependencies,omitempty" toml:"dependencies,omitempty"`
// Codegen configuration for this module.
Codegen *ModuleCodegenConfig `json:"codegen,omitempty" toml:"codegen,omitempty"`
// The clients generated for this module.
Clients []*ModuleConfigClient `json:"clients,omitempty" toml:"clients,omitempty"`
}
CurrentModuleConfig is the dagger-module.toml schema.
type CurrentModuleConfigDependency ¶
type CurrentModuleConfigDependency struct {
// The name to use for this dependency. By default, the same as the dependency module's name,
// but can also be overridden to use a different name.
Name string `json:"name,omitempty" toml:"name,omitempty"`
// The source ref of the module dependency.
Source string `json:"source" toml:"source"`
// The pinned version of the module dependency.
Pin string `json:"pin,omitempty" toml:"pin,omitempty"`
}
CurrentModuleConfigDependency is a dagger-module.toml dependency.
type CurrentModuleConfigWithUserFields ¶
type CurrentModuleConfigWithUserFields struct {
ModuleConfigUserFields
CurrentModuleConfig
}
CurrentModuleConfigWithUserFields is the public schema for dagger-module.toml.
type LegacyModuleConfigWithUserFields ¶
type LegacyModuleConfigWithUserFields struct {
ModuleConfigUserFields
ModuleConfig
}
LegacyModuleConfigWithUserFields is the frozen public schema for dagger.json.
type ModuleCodegenConfig ¶ added in v0.10.3
type ModuleCodegenConfig struct {
// Whether to automatically generate a .gitignore file for this module.
AutomaticGitignore *bool `json:"automaticGitignore,omitempty" toml:"automaticGitignore,omitempty"`
}
func (ModuleCodegenConfig) Clone ¶ added in v0.16.0
func (cfg ModuleCodegenConfig) Clone() *ModuleCodegenConfig
type ModuleConfig ¶ added in v0.9.8
type ModuleConfig struct {
// The name of the module.
Name string `json:"name"`
// The version of the engine this module was last updated with.
EngineVersion string `json:"engineVersion"`
// The runtime this module uses. It is serialized as "runtime" in
// dagger-module.toml and as "sdk" in legacy dagger.json.
SDK *SDK `json:"sdk,omitempty"`
// An optional blueprint module
Blueprint *ModuleConfigDependency `json:"blueprint,omitempty"`
// Toolchain modules
Toolchains []*ModuleConfigDependency `json:"toolchains,omitempty"`
// Paths to explicitly include from the module, relative to the configuration file.
Include []string `json:"include,omitempty"`
// The modules this module depends on.
Dependencies []*ModuleConfigDependency `json:"dependencies,omitempty"`
// The path, relative to this config file, to the subdir containing the module's implementation source code.
Source string `json:"source,omitempty"`
// Codegen configuration for this module.
Codegen *ModuleCodegenConfig `json:"codegen,omitempty"`
// Paths to explicitly exclude from the module, relative to the configuration file.
//
// Deprecated: Use !<pattern> in the include list instead.
Exclude []string `json:"exclude,omitempty"`
// The clients generated for this module.
Clients []*ModuleConfigClient `json:"clients,omitempty"`
// If true, disable the new default function caching behavior for this module. Functions will
// instead default to the old behavior of per-session caching.
DisableDefaultFunctionCaching *bool `json:"disableDefaultFunctionCaching,omitempty"`
}
ModuleConfig is the config for a single module as loaded from a module config file. Only contains fields that are set/edited by dagger utilities.
func (*ModuleConfig) DependencyByName ¶ added in v0.9.8
func (modCfg *ModuleConfig) DependencyByName(name string) (*ModuleConfigDependency, bool)
func (*ModuleConfig) UnmarshalJSON ¶ added in v0.9.9
func (modCfg *ModuleConfig) UnmarshalJSON(data []byte) error
type ModuleConfigArgument ¶ added in v0.19.5
type ModuleConfigArgument struct {
// The function chain to apply this argument to. Empty or nil for constructor.
Function []string `json:"function,omitempty"`
// The name of the argument to override.
Argument string `json:"argument"`
// The default value to use for this argument.
Default string `json:"default,omitempty"`
// The default path to use for File or Directory arguments.
DefaultPath string `json:"defaultPath,omitempty"`
// The default address to use for Container arguments.
DefaultAddress string `json:"defaultAddress,omitempty"`
// Ignore patterns for Directory arguments.
Ignore []string `json:"ignore,omitempty"`
}
ModuleConfigArgument represents an argument override for a toolchain function
type ModuleConfigClient ¶ added in v0.16.3
type ModuleConfigClient struct {
// The generator the client uses to be generated.
Generator string `field:"true" name:"generator" json:"generator" toml:"generator" doc:"The generator to use"`
// The directory the client is generated in.
Directory string `field:"true" name:"directory" json:"directory" toml:"directory" doc:"The directory the client is generated in."`
}
func (ModuleConfigClient) Clone ¶ added in v0.16.3
func (m ModuleConfigClient) Clone() *ModuleConfigClient
func (*ModuleConfigClient) Type ¶ added in v0.16.3
func (*ModuleConfigClient) Type() *ast.Type
func (*ModuleConfigClient) TypeDescription ¶ added in v0.16.3
func (*ModuleConfigClient) TypeDescription() string
type ModuleConfigDependency ¶ added in v0.9.8
type ModuleConfigDependency struct {
// The name to use for this dependency. By default, the same as the dependency module's name,
// but can also be overridden to use a different name.
Name string `json:"name"`
// The source ref of the module dependency.
Source string `json:"source"`
// The pinned version of the module dependency.
Pin string `json:"pin,omitempty"`
// Customizations configuration for toolchains that override function argument pragmas.
Customizations []*ModuleConfigArgument `json:"customizations,omitempty"`
// IgnoreChecks is a list of check patterns to exclude from this toolchain.
// Patterns can use glob syntax to match check names.
IgnoreChecks []string `json:"ignoreChecks,omitempty"`
// IgnoreGenerators is a list of generator patterns to exclude from this toolchain.
// Patterns can use glob syntax to match generator names.
IgnoreGenerators []string `json:"ignoreGenerators,omitempty"`
// IgnoreServices is a list of service (up) patterns to exclude from this toolchain.
// Patterns can use glob syntax to match service names.
IgnoreServices []string `json:"ignoreServices,omitempty"`
// PortMappings maps service names to port forwarding rules.
// Keys are service names (e.g. "web", "infra:database").
// Values are arrays of "hostPort:containerPort" strings (e.g. ["3000:80"]).
PortMappings map[string][]string `json:"portMappings,omitempty"`
}
func (*ModuleConfigDependency) UnmarshalJSON ¶ added in v0.9.8
func (depCfg *ModuleConfigDependency) UnmarshalJSON(data []byte) error
type ModuleConfigUserFields ¶ added in v0.15.2
type ModuleConfigUserFields struct {
// The self-describing config schema.
Schema string `json:"$schema,omitempty" toml:"$schema,omitempty"`
}
type ModuleConfigView ¶ added in v0.10.3
type ModuleConfigWithUserFields ¶ added in v0.15.2
type ModuleConfigWithUserFields struct {
ModuleConfigUserFields
ModuleConfig
}
ModuleConfigWithUserFields is the config for a single module as loaded from a module config file. Includes additional fields that should only be set by the user.
func ParseModuleConfig ¶ added in v0.16.2
func ParseModuleConfig(src []byte) (*ModuleConfigWithUserFields, error)
func ParseModuleConfigForFilename ¶
func ParseModuleConfigForFilename(src []byte, filename string) (*ModuleConfigWithUserFields, error)
func ParseModuleConfigForFormat ¶
func ParseModuleConfigForFormat(src []byte, format ConfigFormat) (*ModuleConfigWithUserFields, error)
func (*ModuleConfigWithUserFields) UnmarshalJSON ¶ added in v0.15.2
func (modCfg *ModuleConfigWithUserFields) UnmarshalJSON(data []byte) error
type SDK ¶ added in v0.15.4
type SDK struct {
Source string `json:"source" toml:"source"`
Config map[string]any `json:"config,omitempty" toml:"config,omitempty"`
Debug bool `json:"debug,omitempty" toml:"debug,omitempty"`
// The experimental features enabled for this module.
Experimental map[string]bool `json:"experimental,omitempty" toml:"experimental,omitempty"`
}
SDK represents the runtime/sdk field in module config. The source can be reference to a built-in sdk e.g. go, php, elixir or can be a reference to a git path e.g. github.com/username/reponame/sdk-name