daggers

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 11 Imported by: 0

README

daggers

import "github.com/eunomie/dague/daggers"

Index

Variables

var goModDefaulFiles = []string{"go.mod", "go.sum"}

func ApplyFormatAndImports

func ApplyFormatAndImports(ctx context.Context, c *Client, formatter string, locals []string) error

func ApplyGoformatter

func ApplyGoformatter(ctx context.Context, c *Client, formatter string) error

func CheckGoDoc

func CheckGoDoc(ctx context.Context, c *Client) error

func CrossBuild

func CrossBuild(ctx context.Context, c *Client, buildOpts types.CrossBuildOpts) error

func ExportGoMod

func ExportGoMod(ctx context.Context, c *Client) error

func GoBase

func GoBase(c *Client) *dagger.Container

GoBase is a default container based on a Golang build image (see config.BuildImage) on top of which is installed several packages and Go packages. The workdir is also set based on config.AppDir.

This container is used as the root of many other commands, allowing to share cache as much as possible.

func GoDeps

func GoDeps(c *Client) *dagger.Container

GoDeps mount the Go module files and download the needed dependencies.

func GoDoc

func GoDoc(ctx context.Context, c *Client) error

func GoImportsPrint

func GoImportsPrint(ctx context.Context, c *Client, locals []string) error

func GoImportsWrite

func GoImportsWrite(ctx context.Context, c *Client, locals []string) error

func GoMod

func GoMod(c *Client) *dagger.Container

func GoVulnCheck

func GoVulnCheck(ctx context.Context, c *Client) error

func GolangCILint

func GolangCILint(ctx context.Context, c *Client) error

func GolangCILintBase

func GolangCILintBase(c *Client) *dagger.Container

func LocalBuild

func LocalBuild(ctx context.Context, c *Client, buildOpts types.LocalBuildOpts) error

func PrintFormatAndImports

func PrintFormatAndImports(ctx context.Context, c *Client, formatter string, locals []string) error

func PrintGoformatter

func PrintGoformatter(ctx context.Context, c *Client, formatter string) error

func RunGoTests

func RunGoTests(ctx context.Context, c *Client) error

func RunInDagger

func RunInDagger(ctx context.Context, conf *config.Dague, do func(*Client) error) error

func Sources

func Sources(c *Client) *dagger.Container

Sources is a container based on GoDeps. It contains the Go source code but also all the needed dependencies from Go modules.

func SourcesNoDeps

func SourcesNoDeps(c *Client) *dagger.Container

SourcesNoDeps is a container including all the source code, but without the Go modules downloaded. It can be helpful with projects where dependencies are vendored but also just minimise the number of steps when it's not required.

func applyBase

func applyBase(cont *dagger.Container, c *dagger.Client, conf *config.Dague) *dagger.Container

func formatPrint

func formatPrint(formatter string) []string

func formatWrite

func formatWrite(formatter string) []string

func goBuild

func goBuild(ctx context.Context, c *Client, src *dagger.Container, os, arch string, buildOpts types.BuildOpts, buildFile string) error

func goImportsPrint

func goImportsPrint(locals []string) []string

func goImportsWrite

func goImportsWrite(locals []string) []string

func goModDownload

func goModDownload() []string

GoModDownload runs the go mod download command.

func goModFiles

func goModFiles(c *Client) *dagger.Directory

GoModFiles creates a directory containing the default go mod files.

func goModTidy

func goModTidy() []string

GoModTidy runs the go mod tidy command.

func sources

func sources(c *Client, cont *dagger.Container) *dagger.Container

type Client

type Client struct {
    Dagger *dagger.Client
    Config *config.Dague
}
func NewClient
func NewClient(c *dagger.Client, conf *config.Dague) *Client

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFormatAndImports added in v0.5.1

func ApplyFormatAndImports(ctx context.Context, c *Client, formatter string, locals []string) error

func ApplyGoformatter added in v0.5.1

func ApplyGoformatter(ctx context.Context, c *Client, formatter string) error

func CheckGoDoc added in v0.3.0

func CheckGoDoc(ctx context.Context, c *Client) error

func CrossBuild

func CrossBuild(ctx context.Context, c *Client, buildOpts types.CrossBuildOpts) error

func ExportGoMod

func ExportGoMod(ctx context.Context, c *Client) error

func GoBase added in v0.5.1

func GoBase(c *Client) *dagger.Container

GoBase is a default container based on a Golang build image (see config.BuildImage) on top of which is installed several packages and Go packages. The workdir is also set based on config.AppDir.

This container is used as the root of many other commands, allowing to share cache as much as possible.

func GoDeps

func GoDeps(c *Client) *dagger.Container

GoDeps mount the Go module files and download the needed dependencies.

func GoDoc

func GoDoc(ctx context.Context, c *Client) error

func GoImportsPrint added in v0.13.0

func GoImportsPrint(ctx context.Context, c *Client, locals []string) error

func GoImportsWrite added in v0.13.0

func GoImportsWrite(ctx context.Context, c *Client, locals []string) error

func GoMod

func GoMod(c *Client) *dagger.Container

func GoVulnCheck

func GoVulnCheck(ctx context.Context, c *Client) error

func GolangCILint added in v0.5.1

func GolangCILint(ctx context.Context, c *Client) error

func GolangCILintBase added in v0.5.1

func GolangCILintBase(c *Client) *dagger.Container

func LocalBuild

func LocalBuild(ctx context.Context, c *Client, buildOpts types.LocalBuildOpts) error

func PrintFormatAndImports added in v0.13.0

func PrintFormatAndImports(ctx context.Context, c *Client, formatter string, locals []string) error

func PrintGoformatter added in v0.5.1

func PrintGoformatter(ctx context.Context, c *Client, formatter string) error

func RunGoTests

func RunGoTests(ctx context.Context, c *Client) error

func RunInDagger added in v0.5.1

func RunInDagger(ctx context.Context, conf *config.Dague, do func(*Client) error) error

func Sources

func Sources(c *Client) *dagger.Container

Sources is a container based on GoDeps. It contains the Go source code but also all the needed dependencies from Go modules.

func SourcesNoDeps

func SourcesNoDeps(c *Client) *dagger.Container

SourcesNoDeps is a container including all the source code, but without the Go modules downloaded. It can be helpful with projects where dependencies are vendored but also just minimise the number of steps when it's not required.

Types

type Client added in v0.5.1

type Client struct {
	Dagger *dagger.Client
	Config *config.Dague
}

func NewClient added in v0.5.1

func NewClient(c *dagger.Client, conf *config.Dague) *Client

Jump to

Keyboard shortcuts

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