magecraft

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 3 Imported by: 0

README

magecraft

Go Reference Badge Go Report Card Badge Last Commit Badge Conventional Commits Badge Discord Server Badge

A small Go module to make it easier and quicker to execute commands for use with Magefiles.

Getting Started

Installation
go get -u github.com/kkrypt0nn/magecraft
Example Usage
package main

import "github.com/kkrypt0nn/magecraft"

func main() {
	if err := magecraft.Docker.RunContainer(magecraft.DockerRunContainerOpts{
		Name:  "sftp",
		Image: "atmoz/sftp",
		Ports: []string{"2222:22"},
		ExtraArgs: []string{
			"foo:bar:::baz",
		},
	}); err != nil {
		panic(err)
	}
}

Supported Commands

Binary
Method Command
Binary.Run(opts) Executes a binary
Docker
Method Command
Docker.BuildImage(opts) docker build ...
Docker.RunContainer(opts) docker run ...
Docker.ExecInContainer(name, args...) docker exec ...
Docker.StopContainer(name) docker stop ...
Docker.RemoveContainer(name, force) docker rm [-f] ...
Go
Method Command
Go.Build(opts) go build ...
Helm
Method Command
Helm.AddRepo(name, url, forceUpdate) helm repo add ...
Helm.RemoveRepo(name) helm repo remove ...
Helm.UpdateRepos() helm repo update
Helm.Uninstall(releaseName, namespace) helm uninstall ...
Helm.Upgrade(opts) helm upgrade ...
Minikube
Method Command
Minikube.Start() minikube start
Minikube.LoadImage(image) minikube image load ...
Minikube.Delete() minikube delete

License

This library was made with 💜 by Krypton and is under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Binary binaryCommands

Binary provides methods for common binary commands

View Source
var Docker dockerCommands

Docker provides methods for common docker commands

View Source
var Go goCommands

Go provides methods for common go commands

View Source
var Helm helmCommands

Helm provides methods for common helm commands

View Source
var Minikube minikubeCommands

Minikube provides methods for common minikube commands

Functions

This section is empty.

Types

type BinaryBuildOpts added in v0.3.0

type BinaryBuildOpts struct {
	Path      string
	Env       map[string]string
	ExtraArgs []string
}

BinaryBuildOpts are the options that can be passed to the `Run` method

type DockerBuildImageOpts

type DockerBuildImageOpts struct {
	Dockerfile   string
	ImageName    string
	ImageVersion string
	Context      string
	BuildArgs    map[string]string
}

DockerBuildImageOpts are the options that can be passed to the `BuildImage` method

type DockerRunContainerOpts

type DockerRunContainerOpts struct {
	Name      string
	Image     string
	Ports     []string
	Volumes   []string
	Env       map[string]string
	ExtraArgs []string
}

DockerRunContainerOpts are the options that can be passed to the `RunContainer` method

type GoBuildOpts

type GoBuildOpts struct {
	Target  string
	Output  *string
	LdFlags []string
	Tags    []string
}

GoBuildOpts are the options that can be passed to the `Build` method

type HelmUpgradeOpts

type HelmUpgradeOpts struct {
	Install           bool
	ReleaseName       string
	RepoName          string
	ChartName         string
	ChartFile         string
	Version           *string
	Namespace         *string
	CreateNamespace   bool
	DisableServerSide bool
	ValuesFile        *string
	Values            map[string]string
	StringValues      map[string]string
}

HelmUpgradeOpts are the options that can be passed to the `Upgrade` method

Directories

Path Synopsis
examples
docker command
helm command

Jump to

Keyboard shortcuts

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