magecraft

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 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

Docker
Method Command
Docker.BuildImage(opts) docker build ...
Docker.RunContainer(opts) docker run ...
Docker.ExecInContainer(name, args...) docker exec ...
Docker.RemoveContainer(name) docker rm -f ...
Go
Method Command
Go.Build(opts) go build ...
Helm
Method Command
Helm.AddRepo(name, url) helm repo add ...
Helm.UpdateRepos() helm repo update
Helm.Upgrade(opts) helm upgrade ...
Helm.Uninstall(releaseName, namespace) helm uninstall ...

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 Docker dockerCommands
View Source
var Go goCommands
View Source
var Helm helmCommands

Functions

This section is empty.

Types

type DockerBuildImageOpts

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

type DockerRunContainerOpts

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

type GoBuildOpts

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

type HelmUpgradeOpts

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

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