mage

package module
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 18 Imported by: 1

README

mage

Mage Targets

Example

Check the magefiles/ folder for an example.

Usage

mkdir magefiles
PKG="$(go list -m)"
( cd magefiles; go mod init "${PKG}/magefiles" )
go work init
go work use . ./magefiles

Then create a magefiles/magefile.go like the example magefile.go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean() error

Clean remove generated files.

func CleanLight

func CleanLight() error

CleanLight avoids removing `artifacts/data` but flushes golangci-lint cache.

func Config

func Config(_ context.Context) error

Config checks all configuration.

func InstallE added in v0.1.8

func InstallE(ctx context.Context) error

InstallE installs with release tags and the supplied arguments the command specified by INSTALL_CMD or the first found command if the environment is not specified.

func ModTidy

func ModTidy() error

ModTidy run go mod tidy on all workspaces.

func RunE added in v0.1.8

func RunE(_ context.Context, args string) error

RunE builds with debug tags and the supplied arguments the command specified by RUN_CMD or the first found command if the environment is not specified.

func Test

func Test(ctx context.Context) error

Test runs all tests depending on presence of files (go.mod=golang:test, etc).

func UpdateE added in v0.1.8

func UpdateE(ctx context.Context) error

Types

type Build

type Build mg.Namespace

Build namespace is defined to group Build functions.

func (Build) Debug added in v0.1.4

func (Build) Debug() error

Debug creates the debug artifacts.

func (Build) DebugCommand added in v0.1.13

func (Build) DebugCommand(cmd string) error

DebugCommand creates a debug artifact for the specified command.

func (Build) Release added in v0.1.4

func (Build) Release() error

Release creates the release artifacts.

func (Build) ReleaseCommand added in v0.1.9

func (Build) ReleaseCommand(cmd string) error

ReleaseCommand creates a release artifact for the specified command.

type Docker added in v0.1.4

type Docker mg.Namespace

Docker namespace is defined to group Docker functions.

func (Docker) Build added in v0.1.4

func (Docker) Build(ctx context.Context) error

Build Builds a docker image for the current platform and "loads" the image into the local Docker server.

func (Docker) Push added in v0.1.4

func (Docker) Push(ctx context.Context) error

Push Builds docker images for each target platform and pushes those images, and a manifest list to the registry.

func (Docker) Test added in v0.1.4

func (Docker) Test(ctx context.Context) error

Test Builds docker images for each target platform then discards the result.

type Golang added in v0.1.4

type Golang mg.Namespace

Golang namespace is defined to group Golang functions.

func (Golang) Fmt added in v0.1.22

func (Golang) Fmt() error

Fmt run go fmt.

func (Golang) Lint added in v0.1.6

func (Golang) Lint() error

Lint run golangci-lint.

func (Golang) Test added in v0.1.4

func (Golang) Test() error

Test run test suite and save coverage report.

func (Golang) Vet added in v0.1.22

func (Golang) Vet() error

Vet run go vet.

func (Golang) Vulncheck added in v0.1.4

func (Golang) Vulncheck(ctx context.Context) error

Vulncheck runs govulncheck.

type Goreleaser added in v0.1.10

type Goreleaser mg.Namespace

Goreleaser namespace is defined to group Goreleaser functions.

func (Goreleaser) Build added in v0.1.10

func (Goreleaser) Build(ctx context.Context) error

Build Goreleaser config.

func (Goreleaser) Healthcheck added in v0.1.10

func (Goreleaser) Healthcheck(ctx context.Context) error

Healthcheck Goreleaser config.

func (Goreleaser) Lint added in v0.1.10

func (Goreleaser) Lint(ctx context.Context) error

Lint Goreleaser config.

type Install added in v0.1.7

type Install mg.Namespace

Install namespace is defined to group Install functions.

func (Install) Command added in v0.1.7

func (Install) Command(_ context.Context, cmd string) error

Command installs a release version of a supplied command.

func (Install) CommandAll added in v0.1.8

func (Install) CommandAll(_ context.Context) error

Command installs a release version of a supplied command.

type Kubebuilder added in v0.1.22

type Kubebuilder mg.Namespace

Kubebuilder namespace is defined to group Kubebuilder functions.

func (Kubebuilder) Deploy added in v0.1.22

func (Kubebuilder) Deploy(ctx context.Context) error

Deploy controller to the K8s cluster specified in ~/.kube/config.

func (Kubebuilder) Generate added in v0.1.22

func (Kubebuilder) Generate(_ context.Context) error

Generate Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

func (Kubebuilder) Install added in v0.1.22

func (Kubebuilder) Install(ctx context.Context) error

Install CRDs into the K8s cluster specified in ~/.kube/config.

func (Kubebuilder) Manifests added in v0.1.22

func (Kubebuilder) Manifests(_ context.Context) error

Manifests Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.

func (Kubebuilder) Run added in v0.1.22

func (Kubebuilder) Run(ctx context.Context) error

Run a controller from your host.

func (Kubebuilder) Undeploy added in v0.1.22

func (Kubebuilder) Undeploy(ctx context.Context) error

Undeploy Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.

func (Kubebuilder) Uninstall added in v0.1.22

func (Kubebuilder) Uninstall(ctx context.Context) error

Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.

type Lint

type Lint mg.Namespace

Lint namespace is defined to group Lint functions.

func (Lint) Golang added in v0.1.6

func (Lint) Golang(ctx context.Context)

Golangci Golang linters.

type Mirrord added in v0.1.4

type Mirrord mg.Namespace

Mirrord namespace is defined to group Mirrord functions.

func (Mirrord) VsCodeDebugConfig added in v0.1.4

func (Mirrord) VsCodeDebugConfig(_ context.Context) error

VsCodeDebugConfig generates debug launch.json in service project dir.

type Protobuf

type Protobuf mg.Namespace

Protobuf namespace is defined to group Protocol buffer functions.

func (Protobuf) GenGo added in v0.1.4

func (Protobuf) GenGo(ctx context.Context) error

ProtobufGenGo run protoc-gen-go to generate code.

func (Protobuf) GenGoGRPC added in v0.1.4

func (Protobuf) GenGoGRPC(ctx context.Context) error

GenGoGRPC run protoc-gen-go-grpc to generate code.

func (Protobuf) GenGoTwirp added in v0.1.4

func (Protobuf) GenGoTwirp(ctx context.Context) error

GenGoTwirp run protoc-gen-go-twirp to generate code.

func (Protobuf) Generate added in v0.1.4

func (Protobuf) Generate(ctx context.Context)

Generate install and generate golang Protocol Buffer files.

func (Protobuf) GenerateWithTwirp added in v0.1.4

func (Protobuf) GenerateWithTwirp(ctx context.Context)

GenerateWithTwirp install and generate golang Protocol Buffer files (including Twirp).

type Run

type Run mg.Namespace

Run namespace is defined to group Run functions.

func (Run) Debug added in v0.1.4

func (Run) Debug(ctx context.Context, cmd string, args string) error

Debug builds and executes the specified command and arguments with debug build flags.

func (Run) Mirrord added in v0.1.7

func (Run) Mirrord(ctx context.Context) error

Mirrord start service with Mirrord intercepts.

func (Run) Release added in v0.1.4

func (Run) Release(ctx context.Context, cmd string, args string) error

Release builds and executes the specified command and arguments with release build flags.

type Update

type Update mg.Namespace

Update namespace is defined to group Update functions.

func (Update) DockerIgnore added in v0.1.8

func (Update) DockerIgnore() error

DockerIgnore writes the .dockerignore file if it does not exist.

func (Update) GitIgnore added in v0.1.4

func (Update) GitIgnore() error

GitIgnore updates the .gitignore from a set list.

func (Update) GoWorkspace added in v0.1.4

func (Update) GoWorkspace() error

GoWorkspace create the go.work file if it is missing.

func (Update) GolangciLint added in v0.1.4

func (Update) GolangciLint() error

GolangciLint updates the .golangci.yml from the gist.

type Wire added in v0.1.14

type Wire mg.Namespace

Wire namespace is defined to group Wire functions.

func (Wire) Generate added in v0.1.14

func (Wire) Generate(ctx context.Context) error

Generate install and generate golang wire dependency files.

func (Wire) Lint added in v0.1.14

func (Wire) Lint(ctx context.Context) error

Generate install and generate golang wire dependency files.

Directories

Path Synopsis
cmd
Package semver implements comparison of semantic version strings.
Package semver implements comparison of semantic version strings.

Jump to

Keyboard shortcuts

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