Refactor agent plan storage, update docs, and release v6 (#2977)
goreleaser / goreleaser (push) Has been cancelled

* test(harness): read agent plan from the scoped store

The store-scoping change moved an agent's plan from the default table
key agent/{name}/plan to its own table (database "agent", table {name},
key "plan"). The plan-delegate harness tests still read the old key and
failed with 'not found'; read through store.Scope(mem, "agent", name)
like the agent does.

* docs: orient agents-first across README, landing, and docs overview

Lead with agents (then services and flows), surface MCP + A2A as the
interop story, and frame agents as services. Landing hero and feature
grid reordered agents-first with an A2A gateway card.

* v6: module path go-micro.dev/v6, TLS secure by default, NewService

Cut v6. Three breaking changes, bundled so the major bump is paid once:

- Module path go-micro.dev/v5 -> go-micro.dev/v6 across all imports + go.mod.
- TLS verification on by default (was off). MICRO_TLS_SECURE removed;
  MICRO_TLS_INSECURE=true opts out for self-signed/dev.
- micro.NewService(name, opts...) is the canonical service constructor,
  symmetric with NewAgent/NewFlow; micro.New kept as a deprecated alias;
  the old name-less NewService(opts...) removed. Generators emit NewService.

Also ports the JWT auth token provider in-module (go-micro.dev/v6/auth/jwt/token
on golang-jwt/jwt/v5), dropping the v5-pinned github.com/micro/plugins/v5/auth/jwt
and the deprecated dgrijalva/jwt-go.

Docs/README/landing updated to v6 and @latest; v5->v6 migration guide added;
CHANGELOG cut as [6.0.0]. Blog posts left at their historical versions.

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Asim Aslam
2026-06-18 11:55:35 +01:00
committed by GitHub
parent b9586f920b
commit c7657f73f4
437 changed files with 1461 additions and 1422 deletions
+12 -3
View File
@@ -7,7 +7,16 @@ calendar-based versions (YYYY.MM) for the AI-native era.
---
## [Unreleased]
## [6.0.0] - June 2026
The AI-native major release. Breaking changes are listed first; everything
else is additive. See the [v5 → v6 migration guide](internal/website/docs/guides/migration/v5-to-v6.md) — it's a small upgrade.
### Changed (breaking)
- **Module path is now `go-micro.dev/v6`.** Update imports (`go-micro.dev/v5/...``go-micro.dev/v6/...`) and `go install go-micro.dev/v6/cmd/micro@latest`.
- **TLS verification is on by default.** v5 skipped verification unless `MICRO_TLS_SECURE=true`; v6 verifies by default. `MICRO_TLS_SECURE` is removed — set `MICRO_TLS_INSECURE=true` (or call `tls.InsecureConfig()`) for self-signed/dev certs.
- **`micro.NewService(name, opts...)` is the service constructor**, symmetric with `NewAgent`/`NewFlow`. `micro.New(name, opts...)` remains as a deprecated alias; the old name-less `micro.NewService(opts...)` form is removed (pass the name positionally). Generators emit the new form.
- **JWT auth ported in-module.** The external `github.com/micro/plugins/v5/auth/jwt` (pinned to v5) is replaced by `go-micro.dev/v6/auth/jwt/token`, now on the maintained `golang-jwt/jwt/v5`; the deprecated `dgrijalva/jwt-go` dependency is dropped.
### Added
- **A2A protocol — both directions** — `gateway/a2a` exposes registered agents over the open Agent2Agent (A2A) protocol so agents on other frameworks can discover and call them: Agent Cards are generated from registry metadata (the same way the MCP gateway derives tools), and incoming tasks are translated to the agent's existing `Agent.Chat` RPC, with no per-agent code (`micro a2a serve`). The outbound `a2a.Client` calls external A2A agents by URL, wired into `flow.A2A(url)` (a workflow step) and `delegate` to an `http(s)` URL (from inside an agent). An agent can also serve A2A **directly** without a gateway via `AgentA2A(addr)` (`a2a.NewAgentHandler`), handling tasks in-process. v1 is the synchronous JSON-RPC binding (`message/send`, `tasks/get`, card discovery); streaming and push notifications are advertised as unsupported. (`gateway/a2a/`, `cmd/micro/a2a/`)
@@ -37,10 +46,10 @@ calendar-based versions (YYYY.MM) for the AI-native era.
#### Developer Experience
- **`micro new` MCP templates** — `micro new myservice` generates MCP-enabled services with doc comments, `@example` tags, and `WithMCP()` wired in. Use `--no-mcp` to opt out.
- **`micro.New("name")` unified API** — single way to create services: `micro.New("greeter")` or `micro.New("greeter", micro.Address(":8080"))`. Replaces `micro.NewService()` + `service.New()` dual API.
- **`micro.NewService("name")` unified API** — single way to create services: `micro.NewService("greeter")` or `micro.NewService("greeter", micro.Address(":8080"))`. Replaces `micro.NewService()` + `service.New()` dual API.
- **`service.Handle()` simplified registration** — register handlers with `service.Handle(new(Greeter))` instead of manual `server.NewHandler` + `server.Handle`.
- **`micro.NewGroup()` modular monoliths** — run multiple services in one binary with shared lifecycle: `micro.NewGroup(users, orders).Run()`.
- **`mcp.WithMCP()` one-liner** — add MCP to any service with a single option: `micro.New("name", mcp.WithMCP(":3001"))`.
- **`mcp.WithMCP()` one-liner** — add MCP to any service with a single option: `micro.NewService("name", mcp.WithMCP(":3001"))`.
- **CRUD example** — contact book service with 6 operations, rich agent docs, and validation patterns (`examples/mcp/crud/`).
#### MCP Gateway
+9 -9
View File
@@ -1,8 +1,8 @@
# Go Micro [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/go-micro.dev/v5?tab=doc) [![Go Report Card](https://goreportcard.com/badge/github.com/go-micro/go-micro)](https://goreportcard.com/report/github.com/go-micro/go-micro)
# Go Micro [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/go-micro.dev/v6?tab=doc) [![Go Report Card](https://goreportcard.com/badge/github.com/go-micro/go-micro)](https://goreportcard.com/report/github.com/go-micro/go-micro)
Go Micro is a framework for building services and agents in Go.
Go Micro is a framework for building agents and services in Go.
Write services they register, discover each other, and communicate via RPC and events. Every endpoint is automatically an AI-callable tool via [MCP](https://modelcontextprotocol.io/). Build agents to manage them intelligently. Both are Go code, both use the same primitives, both deploy the same way.
Build an agent and it gets a model, memory, and tools, manages your services, and is reachable over [MCP](https://modelcontextprotocol.io/) and [A2A](https://a2a-protocol.org). Write services and they register, discover each other, and every endpoint is automatically an AI-callable tool. Orchestrate the deterministic parts with flows. Agents, services, and flows are all Go code — the same primitives, the same deployment — because an agent is a distributed system, and building one is building a service.
## Sponsors
@@ -34,7 +34,7 @@ Install the CLI:
curl -fsSL https://go-micro.dev/install.sh | sh
# Or with Go
go install go-micro.dev/v5/cmd/micro@v5.27.0
go install go-micro.dev/v6/cmd/micro@latest
```
### Fastest start — no API key
@@ -117,7 +117,7 @@ Under the hood, a service is a struct with methods. Doc comments and `@example`
package main
import (
"go-micro.dev/v5"
"go-micro.dev/v6"
)
type Request struct {
@@ -138,7 +138,7 @@ func (h *Say) Hello(ctx context.Context, req *Request, rsp *Response) error {
}
func main() {
service := micro.New("greeter")
service := micro.NewService("greeter")
service.Handle(new(Say))
service.Run()
}
@@ -314,8 +314,8 @@ MCP exposes your services as tools; A2A exposes your agents as agents. See the [
Run multiple services together:
```go
users := micro.New("users", micro.Address(":9001"))
orders := micro.New("orders", micro.Address(":9002"))
users := micro.NewService("users", micro.Address(":9001"))
orders := micro.NewService("orders", micro.Address(":9002"))
users.Handle(new(Users))
orders.Handle(new(Orders))
@@ -399,4 +399,4 @@ See [all examples](examples/README.md).
- [Deployment](internal/website/docs/deployment.md)
- [Plugins](internal/website/docs/plugins.md)
Package reference: https://pkg.go.dev/go-micro.dev/v5
Package reference: https://pkg.go.dev/go-micro.dev/v6
+12 -12
View File
@@ -20,19 +20,19 @@ import (
"strings"
"sync"
pb "go-micro.dev/v5/agent/proto"
"go-micro.dev/v5/ai"
"go-micro.dev/v5/gateway/a2a"
"go-micro.dev/v5/server"
"go-micro.dev/v5/store"
pb "go-micro.dev/v6/agent/proto"
"go-micro.dev/v6/ai"
"go-micro.dev/v6/gateway/a2a"
"go-micro.dev/v6/server"
"go-micro.dev/v6/store"
_ "go-micro.dev/v5/ai/anthropic"
_ "go-micro.dev/v5/ai/atlascloud"
_ "go-micro.dev/v5/ai/gemini"
_ "go-micro.dev/v5/ai/groq"
_ "go-micro.dev/v5/ai/mistral"
_ "go-micro.dev/v5/ai/openai"
_ "go-micro.dev/v5/ai/together"
_ "go-micro.dev/v6/ai/anthropic"
_ "go-micro.dev/v6/ai/atlascloud"
_ "go-micro.dev/v6/ai/gemini"
_ "go-micro.dev/v6/ai/groq"
_ "go-micro.dev/v6/ai/mistral"
_ "go-micro.dev/v6/ai/openai"
_ "go-micro.dev/v6/ai/together"
)
// Agent is the interface for an AI agent that manages services.
+4 -4
View File
@@ -6,10 +6,10 @@ import (
"fmt"
"strings"
"go-micro.dev/v5/ai"
codecBytes "go-micro.dev/v5/codec/bytes"
"go-micro.dev/v5/gateway/a2a"
"go-micro.dev/v5/store"
"go-micro.dev/v6/ai"
codecBytes "go-micro.dev/v6/codec/bytes"
"go-micro.dev/v6/gateway/a2a"
"go-micro.dev/v6/store"
)
// Built-in agent tools. These are not service endpoints — they are
+3 -3
View File
@@ -4,9 +4,9 @@ import (
"encoding/json"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/store"
"go-micro.dev/v6/ai"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/store"
)
func TestBuiltinTools(t *testing.T) {
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"strings"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/store"
"go-micro.dev/v6/ai"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/store"
)
// toolContent runs a tool call through a handler and returns the content
+5 -5
View File
@@ -5,11 +5,11 @@ import (
"strings"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v5/client"
codecBytes "go-micro.dev/v5/codec/bytes"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/store"
"go-micro.dev/v6/ai"
"go-micro.dev/v6/client"
codecBytes "go-micro.dev/v6/codec/bytes"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/store"
)
// fakeGen drives the fake provider's Generate. Tests set it and reset
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"encoding/json"
"sync"
"go-micro.dev/v5/ai"
"go-micro.dev/v5/store"
"go-micro.dev/v6/ai"
"go-micro.dev/v6/store"
)
// Memory is an agent's conversation memory. Like the rest of the
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"strings"
"testing"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/store"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/store"
)
func TestStoreMemoryPersists(t *testing.T) {
+4 -4
View File
@@ -3,10 +3,10 @@ package agent
import (
"context"
"go-micro.dev/v5/ai"
"go-micro.dev/v5/client"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/store"
"go-micro.dev/v6/ai"
"go-micro.dev/v6/client"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/store"
)
// Option configures an Agent.
+2 -2
View File
@@ -11,8 +11,8 @@ import (
import (
context "context"
client "go-micro.dev/v5/client"
server "go-micro.dev/v5/server"
client "go-micro.dev/v6/client"
server "go-micro.dev/v6/server"
)
// Reference imports to suppress errors if they are not otherwise used.
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"strings"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
// A registered wrapper runs around every tool call and can observe and
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"net/http"
"strings"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func init() {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func TestProvider_String(t *testing.T) {
+2 -2
View File
@@ -7,7 +7,7 @@
//
// Usage:
//
// import _ "go-micro.dev/v5/ai/atlascloud"
// import _ "go-micro.dev/v6/ai/atlascloud"
//
// m := ai.New("atlascloud",
// ai.WithAPIKey("your-api-key"),
@@ -29,7 +29,7 @@ import (
"strings"
"time"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func init() {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func TestProvider_String(t *testing.T) {
+2 -2
View File
@@ -1,8 +1,8 @@
// Package flow is maintained for backward compatibility.
// The canonical import is go-micro.dev/v5/flow.
// The canonical import is go-micro.dev/v6/flow.
package flow
import "go-micro.dev/v5/flow"
import "go-micro.dev/v6/flow"
// Re-export types for backward compatibility.
type Flow = flow.Flow
+2 -2
View File
@@ -2,7 +2,7 @@
//
// Usage:
//
// import _ "go-micro.dev/v5/ai/gemini"
// import _ "go-micro.dev/v6/ai/gemini"
//
// m := ai.New("gemini",
// ai.WithAPIKey("your-api-key"),
@@ -18,7 +18,7 @@ import (
"net/http"
"strings"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func init() {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func TestProvider_String(t *testing.T) {
+2 -2
View File
@@ -5,7 +5,7 @@
//
// Usage:
//
// import _ "go-micro.dev/v5/ai/groq"
// import _ "go-micro.dev/v6/ai/groq"
//
// m := ai.New("groq",
// ai.WithAPIKey("your-api-key"),
@@ -21,7 +21,7 @@ import (
"net/http"
"strings"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func init() {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func TestProvider_String(t *testing.T) {
+2 -2
View File
@@ -5,7 +5,7 @@
//
// Usage:
//
// import _ "go-micro.dev/v5/ai/mistral"
// import _ "go-micro.dev/v6/ai/mistral"
//
// m := ai.New("mistral",
// ai.WithAPIKey("your-api-key"),
@@ -21,7 +21,7 @@ import (
"net/http"
"strings"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func init() {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func TestProvider_String(t *testing.T) {
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"net/http"
"strings"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func init() {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func TestProvider_String(t *testing.T) {
+2 -2
View File
@@ -5,7 +5,7 @@
//
// Usage:
//
// import _ "go-micro.dev/v5/ai/together"
// import _ "go-micro.dev/v6/ai/together"
//
// m := ai.New("together",
// ai.WithAPIKey("your-api-key"),
@@ -21,7 +21,7 @@ import (
"net/http"
"strings"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func init() {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
)
func TestProvider_String(t *testing.T) {
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"strings"
"sync"
"go-micro.dev/v5/client"
codecBytes "go-micro.dev/v5/codec/bytes"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/client"
codecBytes "go-micro.dev/v6/codec/bytes"
"go-micro.dev/v6/registry"
)
type toolNameMap struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"testing"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/registry"
)
func TestToolJSONType(t *testing.T) {
+3 -3
View File
@@ -4,9 +4,9 @@ import (
"sync"
"time"
jwtToken "github.com/micro/plugins/v5/auth/jwt/token"
"go-micro.dev/v5/auth"
"go-micro.dev/v5/cmd"
"go-micro.dev/v6/auth"
jwtToken "go-micro.dev/v6/auth/jwt/token"
"go-micro.dev/v6/cmd"
)
func init() {
+5 -5
View File
@@ -4,8 +4,8 @@ import (
"encoding/base64"
"time"
"github.com/dgrijalva/jwt-go"
"go-micro.dev/v5/auth"
"github.com/golang-jwt/jwt/v5"
"go-micro.dev/v6/auth"
)
// authClaims to be encoded in the JWT.
@@ -14,7 +14,7 @@ type authClaims struct {
Scopes []string `json:"scopes"`
Metadata map[string]string `json:"metadata"`
jwt.StandardClaims
jwt.RegisteredClaims
}
// JWT implementation of token provider.
@@ -49,10 +49,10 @@ func (j *JWT) Generate(acc *auth.Account, opts ...GenerateOption) (*Token, error
// generate the JWT
expiry := time.Now().Add(options.Expiry)
t := jwt.NewWithClaims(jwt.SigningMethodRS256, authClaims{
acc.Type, acc.Scopes, acc.Metadata, jwt.StandardClaims{
acc.Type, acc.Scopes, acc.Metadata, jwt.RegisteredClaims{
Subject: acc.ID,
Issuer: acc.Issuer,
ExpiresAt: expiry.Unix(),
ExpiresAt: jwt.NewNumericDate(expiry),
},
})
tok, err := t.SignedString(key)
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"testing"
"time"
"go-micro.dev/v5/auth"
"go-micro.dev/v6/auth"
)
func TestGenerate(t *testing.T) {
+1 -1
View File
@@ -3,7 +3,7 @@ package token
import (
"time"
"go-micro.dev/v5/store"
"go-micro.dev/v6/store"
)
type Options struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"errors"
"time"
"go-micro.dev/v5/auth"
"go-micro.dev/v6/auth"
)
var (
+1 -1
View File
@@ -14,7 +14,7 @@
package noop
import (
"go-micro.dev/v5/auth"
"go-micro.dev/v6/auth"
)
// NewAuth returns a new noop auth provider.
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"time"
"go-micro.dev/v5/logger"
"go-micro.dev/v6/logger"
)
func NewOptions(opts ...Option) Options {
+8 -8
View File
@@ -15,14 +15,14 @@ import (
"time"
"github.com/google/uuid"
"go-micro.dev/v5/codec/json"
merr "go-micro.dev/v5/errors"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/registry/cache"
"go-micro.dev/v5/transport/headers"
maddr "go-micro.dev/v5/internal/util/addr"
mnet "go-micro.dev/v5/internal/util/net"
mls "go-micro.dev/v5/internal/util/tls"
"go-micro.dev/v6/codec/json"
merr "go-micro.dev/v6/errors"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/registry/cache"
"go-micro.dev/v6/transport/headers"
maddr "go-micro.dev/v6/internal/util/addr"
mnet "go-micro.dev/v6/internal/util/net"
mls "go-micro.dev/v6/internal/util/tls"
"golang.org/x/net/http2"
)
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"time"
"github.com/google/uuid"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/registry"
)
var (
+3 -3
View File
@@ -7,9 +7,9 @@ import (
"sync"
"github.com/google/uuid"
log "go-micro.dev/v5/logger"
maddr "go-micro.dev/v5/internal/util/addr"
mnet "go-micro.dev/v5/internal/util/net"
log "go-micro.dev/v6/logger"
maddr "go-micro.dev/v6/internal/util/addr"
mnet "go-micro.dev/v6/internal/util/net"
)
type memoryBroker struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"go-micro.dev/v5/broker"
"go-micro.dev/v6/broker"
)
func TestMemoryBroker(t *testing.T) {
+1 -1
View File
@@ -3,7 +3,7 @@ package nats
import (
"context"
"go-micro.dev/v5/broker"
"go-micro.dev/v6/broker"
)
// setBrokerOption returns a function to setup a context with given value.
+4 -4
View File
@@ -9,10 +9,10 @@ import (
"time"
natsp "github.com/nats-io/nats.go"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/codec/json"
"go-micro.dev/v5/logger"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/codec/json"
"go-micro.dev/v6/logger"
"go-micro.dev/v6/registry"
)
type natsBroker struct {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"testing"
natsp "github.com/nats-io/nats.go"
"go-micro.dev/v5/broker"
"go-micro.dev/v6/broker"
)
var addrTestCases = []struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"time"
natsp "github.com/nats-io/nats.go"
"go-micro.dev/v5/broker"
"go-micro.dev/v6/broker"
)
type optionsKey struct{}
+3 -3
View File
@@ -4,9 +4,9 @@ import (
"context"
"crypto/tls"
"go-micro.dev/v5/codec"
"go-micro.dev/v5/logger"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/codec"
"go-micro.dev/v6/logger"
"go-micro.dev/v6/registry"
)
type Options struct {
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"time"
amqp "github.com/rabbitmq/amqp091-go"
"go-micro.dev/v5/logger"
mtls "go-micro.dev/v5/internal/util/tls"
mtls "go-micro.dev/v6/internal/util/tls"
"go-micro.dev/v6/logger"
)
type MQExchangeType string
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"testing"
amqp "github.com/rabbitmq/amqp091-go"
"go-micro.dev/v5/logger"
"go-micro.dev/v6/logger"
)
func TestNewRabbitMQConnURL(t *testing.T) {
+2 -2
View File
@@ -3,8 +3,8 @@ package rabbitmq
import (
"context"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/server"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/server"
)
// setSubscribeOption returns a function to setup a context with given value.
+3 -3
View File
@@ -4,9 +4,9 @@ import (
"context"
"time"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/client"
"go-micro.dev/v5/server"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/client"
"go-micro.dev/v6/server"
)
type durableQueueKey struct{}
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"time"
amqp "github.com/rabbitmq/amqp091-go"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/logger"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/logger"
)
type rbroker struct {
+10 -15
View File
@@ -7,12 +7,12 @@ import (
"testing"
"time"
"go-micro.dev/v5/logger"
"go-micro.dev/v6/logger"
micro "go-micro.dev/v5"
broker "go-micro.dev/v5/broker"
rabbitmq "go-micro.dev/v5/broker/rabbitmq"
server "go-micro.dev/v5/server"
micro "go-micro.dev/v6"
broker "go-micro.dev/v6/broker"
rabbitmq "go-micro.dev/v6/broker/rabbitmq"
server "go-micro.dev/v6/server"
)
type Example struct{}
@@ -50,8 +50,7 @@ func TestDurable(t *testing.T) {
s := server.NewServer(server.Broker(b))
service := micro.NewService(
micro.Server(s),
service := micro.NewService("test", micro.Server(s),
micro.Broker(b),
)
h := &Example{}
@@ -82,8 +81,7 @@ func TestWithoutExchange(t *testing.T) {
s := server.NewServer(server.Broker(b))
service := micro.NewService(
micro.Server(s),
service := micro.NewService("test", micro.Server(s),
micro.Broker(b),
)
brkrSub := broker.NewSubscribeOptions(
@@ -140,8 +138,7 @@ func TestFanoutExchange(t *testing.T) {
s := server.NewServer(server.Broker(b))
service := micro.NewService(
micro.Server(s),
service := micro.NewService("test", micro.Server(s),
micro.Broker(b),
)
brkrSub := broker.NewSubscribeOptions(
@@ -198,8 +195,7 @@ func TestDirectExchange(t *testing.T) {
s := server.NewServer(server.Broker(b))
service := micro.NewService(
micro.Server(s),
service := micro.NewService("test", micro.Server(s),
micro.Broker(b),
)
brkrSub := broker.NewSubscribeOptions(
@@ -256,8 +252,7 @@ func TestTopicExchange(t *testing.T) {
s := server.NewServer(server.Broker(b))
service := micro.NewService(
micro.Server(s),
service := micro.NewService("test", micro.Server(s),
micro.Broker(b),
)
brkrSub := broker.NewSubscribeOptions(
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"time"
"go-micro.dev/v5/logger"
"go-micro.dev/v6/logger"
)
// Options represents the options for the cache.
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
rclient "github.com/go-redis/redis/v8"
"go-micro.dev/v5/cache"
"go-micro.dev/v6/cache"
)
type redisOptionsContextKey struct{}
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"testing"
rclient "github.com/go-redis/redis/v8"
"go-micro.dev/v5/cache"
"go-micro.dev/v6/cache"
)
func Test_newUniversalClient(t *testing.T) {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"time"
rclient "github.com/go-redis/redis/v8"
"go-micro.dev/v5/cache"
"go-micro.dev/v6/cache"
)
// NewRedisCache returns a new redis cache.
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"testing"
"time"
"go-micro.dev/v5/cache"
"go-micro.dev/v6/cache"
)
var (
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"time"
"go-micro.dev/v5/internal/util/backoff"
"go-micro.dev/v6/internal/util/backoff"
)
type BackoffFunc func(ctx context.Context, req Request, attempts int) (time.Duration, error)
+2 -2
View File
@@ -9,8 +9,8 @@ import (
cache "github.com/patrickmn/go-cache"
"go-micro.dev/v5/metadata"
"go-micro.dev/v5/transport/headers"
"go-micro.dev/v6/metadata"
"go-micro.dev/v6/transport/headers"
)
// NewCache returns an initialized cache.
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"testing"
"time"
"go-micro.dev/v5/metadata"
"go-micro.dev/v5/transport/headers"
"go-micro.dev/v6/metadata"
"go-micro.dev/v6/transport/headers"
)
func TestCache(t *testing.T) {
+1 -1
View File
@@ -4,7 +4,7 @@ package client
import (
"context"
"go-micro.dev/v5/codec"
"go-micro.dev/v6/codec"
)
var (
+1 -1
View File
@@ -1,7 +1,7 @@
package client
import (
"go-micro.dev/v5/registry"
"go-micro.dev/v6/registry"
)
var (
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"fmt"
"strings"
"go-micro.dev/v5/codec"
"go-micro.dev/v5/codec/bytes"
"go-micro.dev/v6/codec"
"go-micro.dev/v6/codec/bytes"
"google.golang.org/grpc"
"google.golang.org/grpc/encoding"
"google.golang.org/protobuf/encoding/protojson"
+1 -1
View File
@@ -3,7 +3,7 @@ package grpc
import (
"net/http"
"go-micro.dev/v5/errors"
"go-micro.dev/v6/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
+9 -9
View File
@@ -11,15 +11,15 @@ import (
"sync/atomic"
"time"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/client"
"go-micro.dev/v5/cmd"
raw "go-micro.dev/v5/codec/bytes"
"go-micro.dev/v5/errors"
"go-micro.dev/v5/metadata"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/selector"
pnet "go-micro.dev/v5/internal/util/net"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/client"
"go-micro.dev/v6/cmd"
raw "go-micro.dev/v6/codec/bytes"
"go-micro.dev/v6/errors"
"go-micro.dev/v6/metadata"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/selector"
pnet "go-micro.dev/v6/internal/util/net"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/encoding"
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"net"
"testing"
"go-micro.dev/v5/client"
"go-micro.dev/v5/errors"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/selector"
"go-micro.dev/v6/client"
"go-micro.dev/v6/errors"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/selector"
pgrpc "google.golang.org/grpc"
pb "google.golang.org/grpc/examples/helloworld/helloworld"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package grpc
import (
"go-micro.dev/v5/client"
"go-micro.dev/v6/client"
)
type grpcEvent struct {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"context"
"crypto/tls"
"go-micro.dev/v5/client"
"go-micro.dev/v6/client"
"google.golang.org/grpc"
"google.golang.org/grpc/encoding"
)
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
"go-micro.dev/v5/client"
"go-micro.dev/v5/codec"
"go-micro.dev/v6/client"
"go-micro.dev/v6/codec"
)
type grpcRequest struct {
+2 -2
View File
@@ -3,8 +3,8 @@ package grpc
import (
"strings"
"go-micro.dev/v5/codec"
"go-micro.dev/v5/codec/bytes"
"go-micro.dev/v6/codec"
"go-micro.dev/v6/codec/bytes"
"google.golang.org/grpc"
"google.golang.org/grpc/encoding"
)
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"io"
"sync"
"go-micro.dev/v5/client"
"go-micro.dev/v6/client"
"google.golang.org/grpc"
)
+6 -6
View File
@@ -4,12 +4,12 @@ import (
"context"
"time"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/codec"
"go-micro.dev/v5/logger"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/selector"
"go-micro.dev/v5/transport"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/codec"
"go-micro.dev/v6/logger"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/selector"
"go-micro.dev/v6/transport"
)
var (
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"testing"
"time"
"go-micro.dev/v5/transport"
"go-micro.dev/v6/transport"
)
func TestCallOptions(t *testing.T) {
+1 -1
View File
@@ -3,7 +3,7 @@ package client
import (
"context"
"go-micro.dev/v5/errors"
"go-micro.dev/v6/errors"
)
// note that returning either false or a non-nil error will result in the call not being retried.
+13 -13
View File
@@ -10,19 +10,19 @@ import (
"github.com/google/uuid"
"github.com/pkg/errors"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/codec"
raw "go-micro.dev/v5/codec/bytes"
merrors "go-micro.dev/v5/errors"
log "go-micro.dev/v5/logger"
"go-micro.dev/v5/metadata"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/selector"
"go-micro.dev/v5/transport"
"go-micro.dev/v5/transport/headers"
"go-micro.dev/v5/internal/util/buf"
"go-micro.dev/v5/internal/util/net"
"go-micro.dev/v5/internal/util/pool"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/codec"
raw "go-micro.dev/v6/codec/bytes"
merrors "go-micro.dev/v6/errors"
log "go-micro.dev/v6/logger"
"go-micro.dev/v6/metadata"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/selector"
"go-micro.dev/v6/transport"
"go-micro.dev/v6/transport/headers"
"go-micro.dev/v6/internal/util/buf"
"go-micro.dev/v6/internal/util/net"
"go-micro.dev/v6/internal/util/pool"
)
const (
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"fmt"
"testing"
"go-micro.dev/v5/errors"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/selector"
"go-micro.dev/v6/errors"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/selector"
)
const (
+11 -11
View File
@@ -4,17 +4,17 @@ import (
"bytes"
errs "errors"
"go-micro.dev/v5/codec"
raw "go-micro.dev/v5/codec/bytes"
"go-micro.dev/v5/codec/grpc"
"go-micro.dev/v5/codec/json"
"go-micro.dev/v5/codec/jsonrpc"
"go-micro.dev/v5/codec/proto"
"go-micro.dev/v5/codec/protorpc"
"go-micro.dev/v5/errors"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/transport"
"go-micro.dev/v5/transport/headers"
"go-micro.dev/v6/codec"
raw "go-micro.dev/v6/codec/bytes"
"go-micro.dev/v6/codec/grpc"
"go-micro.dev/v6/codec/json"
"go-micro.dev/v6/codec/jsonrpc"
"go-micro.dev/v6/codec/proto"
"go-micro.dev/v6/codec/protorpc"
"go-micro.dev/v6/errors"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/transport"
"go-micro.dev/v6/transport/headers"
)
const (
+1 -1
View File
@@ -1,7 +1,7 @@
package client
import (
"go-micro.dev/v5/codec"
"go-micro.dev/v6/codec"
)
type rpcRequest struct {
+2 -2
View File
@@ -1,8 +1,8 @@
package client
import (
"go-micro.dev/v5/codec"
"go-micro.dev/v5/transport"
"go-micro.dev/v6/codec"
"go-micro.dev/v6/transport"
)
type rpcResponse struct {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"io"
"sync"
"go-micro.dev/v5/codec"
"go-micro.dev/v6/codec"
)
// Implements the streamer interface.
+1 -1
View File
@@ -3,7 +3,7 @@ package client
import (
"context"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/registry"
)
// CallFunc represents the individual call func.
+27 -27
View File
@@ -9,33 +9,33 @@ import (
"time"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/auth"
"go-micro.dev/v5/broker"
nbroker "go-micro.dev/v5/broker/nats"
rabbit "go-micro.dev/v5/broker/rabbitmq"
"go-micro.dev/v5/cache"
"go-micro.dev/v5/cache/redis"
"go-micro.dev/v5/client"
"go-micro.dev/v5/config"
"go-micro.dev/v5/debug/profile"
"go-micro.dev/v5/debug/profile/http"
"go-micro.dev/v5/debug/profile/pprof"
"go-micro.dev/v5/debug/trace"
"go-micro.dev/v5/events"
"go-micro.dev/v5/logger"
mprofile "go-micro.dev/v5/service/profile"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/registry/consul"
"go-micro.dev/v5/registry/etcd"
"go-micro.dev/v5/registry/nats"
"go-micro.dev/v5/selector"
"go-micro.dev/v5/server"
"go-micro.dev/v5/store"
"go-micro.dev/v5/store/mysql"
natsjskv "go-micro.dev/v5/store/nats-js-kv"
postgres "go-micro.dev/v5/store/postgres"
"go-micro.dev/v5/transport"
ntransport "go-micro.dev/v5/transport/nats"
"go-micro.dev/v6/auth"
"go-micro.dev/v6/broker"
nbroker "go-micro.dev/v6/broker/nats"
rabbit "go-micro.dev/v6/broker/rabbitmq"
"go-micro.dev/v6/cache"
"go-micro.dev/v6/cache/redis"
"go-micro.dev/v6/client"
"go-micro.dev/v6/config"
"go-micro.dev/v6/debug/profile"
"go-micro.dev/v6/debug/profile/http"
"go-micro.dev/v6/debug/profile/pprof"
"go-micro.dev/v6/debug/trace"
"go-micro.dev/v6/events"
"go-micro.dev/v6/logger"
mprofile "go-micro.dev/v6/service/profile"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/registry/consul"
"go-micro.dev/v6/registry/etcd"
"go-micro.dev/v6/registry/nats"
"go-micro.dev/v6/selector"
"go-micro.dev/v6/server"
"go-micro.dev/v6/store"
"go-micro.dev/v6/store/mysql"
natsjskv "go-micro.dev/v6/store/nats-js-kv"
postgres "go-micro.dev/v6/store/postgres"
"go-micro.dev/v6/transport"
ntransport "go-micro.dev/v6/transport/nats"
)
type Cmd interface {
+7 -7
View File
@@ -31,13 +31,13 @@ import (
"syscall"
"time"
"go-micro.dev/v5/auth"
"go-micro.dev/v5/auth/jwt"
"go-micro.dev/v5/gateway/mcp"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/registry/consul"
"go-micro.dev/v5/registry/etcd"
"go-micro.dev/v5/wrapper/x402"
"go-micro.dev/v6/auth"
"go-micro.dev/v6/auth/jwt"
"go-micro.dev/v6/gateway/mcp"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/registry/consul"
"go-micro.dev/v6/registry/etcd"
"go-micro.dev/v6/wrapper/x402"
"github.com/urfave/cli/v2"
)
+1 -1
View File
@@ -267,7 +267,7 @@ type Response struct {
}
func main() {
client := micro.New("helloworld").Client()
client := micro.NewService("helloworld").Client()
req := client.NewRequest("helloworld", "Helloworld.Call", &Request{Name: "John"})
+3 -3
View File
@@ -6,9 +6,9 @@ import (
"strings"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/cmd"
"go-micro.dev/v5/gateway/a2a"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/cmd"
"go-micro.dev/v6/gateway/a2a"
"go-micro.dev/v6/registry"
)
func init() {
+6 -6
View File
@@ -27,12 +27,12 @@ import (
"syscall"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/broker"
"go-micro.dev/v5/client"
"go-micro.dev/v5/cmd"
codecBytes "go-micro.dev/v5/codec/bytes"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/store"
"go-micro.dev/v6/broker"
"go-micro.dev/v6/client"
"go-micro.dev/v6/cmd"
codecBytes "go-micro.dev/v6/codec/bytes"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/store"
)
func init() {
+14 -14
View File
@@ -19,21 +19,21 @@ import (
"time"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/agent"
"go-micro.dev/v5/ai"
clt "go-micro.dev/v5/client"
"go-micro.dev/v5/cmd"
"go-micro.dev/v5/cmd/micro/cli/generate"
"go-micro.dev/v5/codec/bytes"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/agent"
"go-micro.dev/v6/ai"
clt "go-micro.dev/v6/client"
"go-micro.dev/v6/cmd"
"go-micro.dev/v6/cmd/micro/cli/generate"
"go-micro.dev/v6/codec/bytes"
"go-micro.dev/v6/registry"
_ "go-micro.dev/v5/ai/anthropic"
_ "go-micro.dev/v5/ai/atlascloud"
_ "go-micro.dev/v5/ai/gemini"
_ "go-micro.dev/v5/ai/groq"
_ "go-micro.dev/v5/ai/mistral"
_ "go-micro.dev/v5/ai/openai"
_ "go-micro.dev/v5/ai/together"
_ "go-micro.dev/v6/ai/anthropic"
_ "go-micro.dev/v6/ai/atlascloud"
_ "go-micro.dev/v6/ai/gemini"
_ "go-micro.dev/v6/ai/groq"
_ "go-micro.dev/v6/ai/mistral"
_ "go-micro.dev/v6/ai/openai"
_ "go-micro.dev/v6/ai/together"
)
const systemPromptTmpl = `You are an agent that orchestrates microservices. Use the available tools to fulfill user requests. When you call a tool, explain what you are doing.
+1 -1
View File
@@ -160,7 +160,7 @@ type Response struct {
}
func main() {
client := micro.New("helloworld").Client()
client := micro.NewService("helloworld").Client()
req := client.NewRequest("helloworld", "Helloworld.Call", &Request{Name: "John"})
+4 -4
View File
@@ -6,10 +6,10 @@ import (
"fmt"
"github.com/urfave/cli/v2"
goagent "go-micro.dev/v5/agent"
"go-micro.dev/v5/cmd"
"go-micro.dev/v5/registry"
"go-micro.dev/v5/store"
goagent "go-micro.dev/v6/agent"
"go-micro.dev/v6/cmd"
"go-micro.dev/v6/registry"
"go-micro.dev/v6/store"
)
func init() {
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"strings"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/cmd"
"go-micro.dev/v5/cmd/micro/run/config"
"go-micro.dev/v6/cmd"
"go-micro.dev/v6/cmd/micro/run/config"
)
// Build builds Go binaries for services
+11 -11
View File
@@ -8,20 +8,20 @@ import (
"os/exec"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/client"
"go-micro.dev/v5/cmd"
"go-micro.dev/v5/codec/bytes"
"go-micro.dev/v5/registry"
"go-micro.dev/v6/client"
"go-micro.dev/v6/cmd"
"go-micro.dev/v6/codec/bytes"
"go-micro.dev/v6/registry"
"go-micro.dev/v5/cmd/micro/cli/new"
"go-micro.dev/v5/cmd/micro/cli/util"
"go-micro.dev/v6/cmd/micro/cli/new"
"go-micro.dev/v6/cmd/micro/cli/util"
// Import packages that register commands via init()
_ "go-micro.dev/v5/cmd/micro/cli/agent"
_ "go-micro.dev/v5/cmd/micro/cli/build"
_ "go-micro.dev/v5/cmd/micro/cli/deploy"
_ "go-micro.dev/v5/cmd/micro/cli/init"
_ "go-micro.dev/v5/cmd/micro/cli/remote"
_ "go-micro.dev/v6/cmd/micro/cli/agent"
_ "go-micro.dev/v6/cmd/micro/cli/build"
_ "go-micro.dev/v6/cmd/micro/cli/deploy"
_ "go-micro.dev/v6/cmd/micro/cli/init"
_ "go-micro.dev/v6/cmd/micro/cli/remote"
)
var (
+2 -2
View File
@@ -11,8 +11,8 @@ import (
"time"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/cmd"
"go-micro.dev/v5/cmd/micro/run/config"
"go-micro.dev/v6/cmd"
"go-micro.dev/v6/cmd/micro/run/config"
)
const (
+3 -3
View File
@@ -9,7 +9,7 @@ import (
"text/template"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/cmd"
"go-micro.dev/v6/cmd"
)
var handlerTemplate = `package handler
@@ -17,7 +17,7 @@ var handlerTemplate = `package handler
import (
"context"
log "go-micro.dev/v5/logger"
log "go-micro.dev/v6/logger"
)
type {{.Name}} struct{}
@@ -43,7 +43,7 @@ import (
"encoding/json"
"net/http"
log "go-micro.dev/v5/logger"
log "go-micro.dev/v6/logger"
)
// {{.Name}}Request is the request for {{.Name}}
+19 -19
View File
@@ -16,22 +16,22 @@ import (
"sync"
"time"
"go-micro.dev/v5/ai"
"go-micro.dev/v6/ai"
_ "go-micro.dev/v5/ai/anthropic"
_ "go-micro.dev/v5/ai/atlascloud"
_ "go-micro.dev/v5/ai/gemini"
_ "go-micro.dev/v5/ai/groq"
_ "go-micro.dev/v5/ai/mistral"
_ "go-micro.dev/v5/ai/openai"
_ "go-micro.dev/v5/ai/together"
_ "go-micro.dev/v6/ai/anthropic"
_ "go-micro.dev/v6/ai/atlascloud"
_ "go-micro.dev/v6/ai/gemini"
_ "go-micro.dev/v6/ai/groq"
_ "go-micro.dev/v6/ai/mistral"
_ "go-micro.dev/v6/ai/openai"
_ "go-micro.dev/v6/ai/together"
)
// goMicroVersion is the go-micro.dev/v5 release pinned into the go.mod of
// goMicroVersion is the go-micro.dev/v6 release pinned into the go.mod of
// every scaffolded project. This is the single source of truth — bump it
// here when cutting a release so generated services and agents stay in
// sync with the framework.
const goMicroVersion = "v5.29.0"
const goMicroVersion = "v6.0.0"
const designPrompt = `You are a Go microservices architect using the go-micro framework.
Given a system description, design the services needed.
@@ -106,9 +106,9 @@ Generate a COMPLETE, COMPILABLE Go handler file.
The handler must:
1. Use package "handler"
2. Import the proto package as: pb "%s/proto"
3. Import go-micro logger as: log "go-micro.dev/v5/logger"
3. Import go-micro logger as: log "go-micro.dev/v6/logger"
4. Import "github.com/google/uuid" for ID generation
5. Use "go-micro.dev/v5/store" for persistent storage (NOT in-memory maps)
5. Use "go-micro.dev/v6/store" for persistent storage (NOT in-memory maps)
6. Include REAL business logic — not just CRUD store operations
7. Every exported method must have a doc comment explaining what it does
8. Every method must have an @example tag with realistic JSON input
@@ -116,7 +116,7 @@ The handler must:
10. Keep the file under 200 lines — be concise, no boilerplate
For storage, use the go-micro store package:
import "go-micro.dev/v5/store"
import "go-micro.dev/v6/store"
import "encoding/json"
// In the struct:
@@ -352,7 +352,7 @@ func generateStructure(dir string, svc ServiceSpec) error {
"GOPATH:=$(shell go env GOPATH)\n\n.PHONY: proto\nproto:\n\tprotoc --proto_path=. --micro_out=. --go_out=. proto/*.proto\n")
writeFile(filepath.Join(dir, "go.mod"),
fmt.Sprintf("module %s\n\ngo 1.24\n\nrequire go-micro.dev/v5 %s\n", name, goMicroVersion))
fmt.Sprintf("module %s\n\ngo 1.24\n\nrequire go-micro.dev/v6 %s\n", name, goMicroVersion))
writeFile(filepath.Join(dir, ".gitignore"),
fmt.Sprintf("%s\n.micro\n", name))
@@ -573,12 +573,12 @@ import (
"%s/handler"
pb "%s/proto"
"go-micro.dev/v5"
"go-micro.dev/v5/gateway/mcp"
"go-micro.dev/v6"
"go-micro.dev/v6/gateway/mcp"
)
func main() {
service := micro.New("%s",
service := micro.NewService("%s",
mcp.WithMCP(":0"),
)
service.Init()
@@ -616,7 +616,7 @@ func generateAgent(baseDir string, design *ServiceDesign, svcNames []string) err
import (
"os"
"go-micro.dev/v5"
"go-micro.dev/v6"
)
func main() {
@@ -632,7 +632,7 @@ func main() {
`, quoted, prompt))
writeFile(filepath.Join(agentDir, "go.mod"),
fmt.Sprintf("module %s\n\ngo 1.24\n\nrequire go-micro.dev/v5 %s\n", agentName, goMicroVersion))
fmt.Sprintf("module %s\n\ngo 1.24\n\nrequire go-micro.dev/v6 %s\n", agentName, goMicroVersion))
runIn(agentDir, "go", "mod", "tidy")
+3 -3
View File
@@ -93,7 +93,7 @@ func TestExtractJSON(t *testing.T) {
func TestExtractCode(t *testing.T) {
tests := []struct {
name, in string
name, in string
wantPrefix string
}{
{
@@ -183,7 +183,7 @@ func TestBuildMain(t *testing.T) {
checks := []string{
`"order/handler"`,
`pb "order/proto"`,
`micro.New("order"`,
`micro.NewService("order"`,
`pb.RegisterOrderHandler`,
`handler.New()`,
}
@@ -198,7 +198,7 @@ func TestBuildMain(t *testing.T) {
checks = []string{
`"order-service/handler"`,
`pb "order-service/proto"`,
`micro.New("order"`,
`micro.NewService("order"`,
`pb.RegisterOrderServiceHandler`,
`handler.New()`,
}
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"strings"
"github.com/urfave/cli/v2"
"go-micro.dev/v5/cmd"
"go-micro.dev/v6/cmd"
)
const systemdTemplate = `[Unit]
+2 -2
View File
@@ -15,13 +15,13 @@ import (
"strings"
"syscall"
"go-micro.dev/v5/cmd/micro/cli/generate"
"go-micro.dev/v6/cmd/micro/cli/generate"
"text/template"
"time"
"github.com/urfave/cli/v2"
"github.com/xlab/treeprint"
tmpl "go-micro.dev/v5/cmd/micro/cli/new/template"
tmpl "go-micro.dev/v6/cmd/micro/cli/new/template"
)
func protoComments(goDir, alias string) []string {
+1 -1
View File
@@ -42,7 +42,7 @@ import (
"net/http"
"time"
log "go-micro.dev/v5/logger"
log "go-micro.dev/v6/logger"
pb "{{.Dir}}/proto"
)
+1 -1
View File
@@ -85,7 +85,7 @@ import (
"time"
"github.com/google/uuid"
log "go-micro.dev/v5/logger"
log "go-micro.dev/v6/logger"
pb "{{.Dir}}/proto"
)
+2 -2
View File
@@ -6,7 +6,7 @@ var (
import (
"context"
log "go-micro.dev/v5/logger"
log "go-micro.dev/v6/logger"
pb "{{.Dir}}/proto"
)
@@ -51,7 +51,7 @@ func (e *{{title .Alias}}) Stream(ctx context.Context, req *pb.StreamingRequest,
import (
"context"
log "go-micro.dev/v5/logger"
log "go-micro.dev/v6/logger"
pb "{{.Dir}}/proto"
)
+5 -5
View File
@@ -7,13 +7,13 @@ import (
"{{.Dir}}/handler"
pb "{{.Dir}}/proto"
"go-micro.dev/v5"
"go-micro.dev/v5/gateway/mcp"
"go-micro.dev/v6"
"go-micro.dev/v6/gateway/mcp"
)
func main() {
// Create service
service := micro.New("{{lower .Alias}}",
service := micro.NewService("{{lower .Alias}}",
mcp.WithMCP(":3001"),
)
@@ -34,12 +34,12 @@ import (
"{{.Dir}}/handler"
pb "{{.Dir}}/proto"
"go-micro.dev/v5"
"go-micro.dev/v6"
)
func main() {
// Create service
service := micro.New("{{lower .Alias}}")
service := micro.NewService("{{lower .Alias}}")
// Initialize service
service.Init()

Some files were not shown because too many files have changed in this diff Show More