mist-go is a standard Go module. Add it to any Go project with go get. No system dependencies, no C libraries, no Docker setup required.
math/rand/v2, log/slog, and generic type parameters)go.mod file)go get github.com/greynewell/mist-go
This adds mist-go to your go.mod and downloads the module. Because mist-go has no external dependencies, go get adds a single entry to your go.mod and nothing to go.sum beyond the module’s own checksums.
Your go.mod will include:
require github.com/greynewell/mist-go v0.1.0
Verify the module’s checksums against the Go checksum database:
go mod verify
To inspect what was downloaded:
go mod download -json github.com/greynewell/mist-go
mist-go packages are independent. Import only the packages you use:
import (
"github.com/greynewell/mist-go/protocol"
"github.com/greynewell/mist-go/transport"
"github.com/greynewell/mist-go/trace"
"github.com/greynewell/mist-go/metrics"
"github.com/greynewell/mist-go/config"
"github.com/greynewell/mist-go/health"
"github.com/greynewell/mist-go/lifecycle"
"github.com/greynewell/mist-go/circuitbreaker"
"github.com/greynewell/mist-go/checkpoint"
"github.com/greynewell/mist-go/parallel"
"github.com/greynewell/mist-go/retry"
"github.com/greynewell/mist-go/logging"
"github.com/greynewell/mist-go/errors"
"github.com/greynewell/mist-go/server"
"github.com/greynewell/mist-go/cli"
"github.com/greynewell/mist-go/output"
"github.com/greynewell/mist-go/resource"
"github.com/greynewell/mist-go/platform"
)
The Go toolchain only compiles packages you actually import, so importing a subset has no overhead from the rest.
A working program that sends a message over HTTP:
package main
import (
"context"
"log"
"github.com/greynewell/mist-go/protocol"
"github.com/greynewell/mist-go/transport"
)
func main() {
ctx := context.Background()
// Create a typed message.
msg, err := protocol.New("my-tool", protocol.TypeHealthPing, protocol.HealthPing{
From: "my-tool",
})
if err != nil {
log.Fatal(err)
}
// Dial a transport from a URL.
t, err := transport.Dial("http://localhost:8080")
if err != nil {
log.Fatal(err)
}
defer t.Close()
if err := t.Send(ctx, msg); err != nil {
log.Fatal(err)
}
}
To pin to a specific release:
go get github.com/greynewell/[email protected]
To update to the latest release:
go get -u github.com/greynewell/mist-go
mist-go works with go mod vendor:
go mod vendor
Because there are no external dependencies, vendoring adds only the mist-go source tree itself. The vendor directory will contain github.com/greynewell/mist-go and nothing else.