modules

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const Filename = "dagger.json"

Filename is the name of the module config file.

Variables

This section is empty.

Functions

func NormalizeConfigPath

func NormalizeConfigPath(configPath string) string

NormalizeConfigPath appends /dagger.json to the given path if it is not already present.

Types

type Config

type Config struct {
	Name         string   `json:"name" field:"true" doc:"The name of the module."`
	Root         string   `` /* 127-byte string literal not displayed */
	SDK          string   `` /* 153-byte string literal not displayed */
	Include      []string `json:"include,omitempty" field:"true" doc:"Include only these file globs when loading the module root."`
	Exclude      []string `json:"exclude,omitempty" field:"true" doc:"Exclude these file globs when loading the module root."`
	Dependencies []string `json:"dependencies,omitempty" field:"true" doc:"Modules that this module depends on."`
}

Config is the module config loaded from dagger.json.

func NewConfig

func NewConfig(name, sdkNameOrRef, rootPath string) *Config

func (*Config) RootAndSubpath

func (cfg *Config) RootAndSubpath(modSourceDir string) (string, string, error)

func (*Config) Type added in v0.9.7

func (cfg *Config) Type() *ast.Type

func (*Config) TypeDescription added in v0.9.7

func (cfg *Config) TypeDescription() string

func (*Config) Use added in v0.9.2

func (cfg *Config) Use(ctx context.Context, dag *dagger.Client, ref *Ref, refs ...string) error

Use adds the given module references to the module's dependencies.

type GitRef

type GitRef struct {
	HTMLURL  string // HTMLURL is the URL a user can use to browse the repo.
	CloneURL string // CloneURL is the URL to clone.
	Commit   string // Commit is the commit to check out.
}

type Ref

type Ref struct {
	Path    string // Path is the provided path for the module.
	Version string // Version is the provided version for the module, if any.

	Local bool    // Local indicates that the module's Path is just a local path.
	Git   *GitRef // Git is the resolved Git information.

	SubPath string // Subdir is the subdirectory within the fetched source.
}

Ref contains all of the information we're able to learn about a provided module ref.

func ResolveModuleDependency

func ResolveModuleDependency(ctx context.Context, dag *dagger.Client, parent *Ref, urlStr string) (*Ref, error)

func ResolveMovingRef

func ResolveMovingRef(ctx context.Context, dag *dagger.Client, modQuery string) (*Ref, error)

func ResolveStableRef

func ResolveStableRef(modQuery string) (*Ref, error)

TODO dedup with ResolveMovingRef

func (*Ref) AsModule

func (ref *Ref) AsModule(ctx context.Context, c *dagger.Client) (*dagger.Module, error)

func (*Ref) AsUninitializedModule added in v0.9.7

func (ref *Ref) AsUninitializedModule(ctx context.Context, c *dagger.Client) (*dagger.Module, error)

func (*Ref) Config

func (ref *Ref) Config(ctx context.Context, c *dagger.Client) (*Config, error)

func (*Ref) LocalSourcePath

func (ref *Ref) LocalSourcePath() (string, error)

func (*Ref) String

func (ref *Ref) String() string

func (*Ref) Symbolic

func (ref *Ref) Symbolic() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳