package main
import (
"context"
"fmt"
"github.com/micro/go-micro/v2"
_ "github.com/micro/go-plugins/broker/grpc/v2"
)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"log" | |
pb "github.com/micro/examples/helloworld/proto" | |
"github.com/micro/go-micro/v2" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Auth interface { | |
// Generate a new account | |
Generate(id string, ...GenerateOption) (*Account, error) | |
// Grant access to a resource | |
Grant(*Account, *Resource) error | |
// Revoke access to a resource | |
Revoke(*Account, *Resource) error | |
// Verify an account has access to a resource | |
Verify(*Account, *Resource) error | |
// Login to an account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
function trap_handler { | |
MYSELF="$0" # equals to my script name | |
LASTLINE="$1" # argument 1: last line of error occurence | |
LASTERR="$2" # argument 2: error code of last command | |
echo "Error: line ${LASTLINE} - exit status of last command: ${LASTERR}" | |
exit $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goroutine 13023 [semacquire, 25 minutes]: | |
sync.runtime_SemacquireMutex(0xc0001bfcbc, 0x0, 0x0) | |
/usr/local/go/src/runtime/sema.go:71 +0x47 | |
sync.(*RWMutex).RLock(...) | |
/usr/local/go/src/sync/rwmutex.go:50 | |
github.com/micro/go-micro/router.(*table).Query(0xc0001bfcb0, 0xc00013a770, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0) | |
/go/pkg/mod/github.com/micro/go-micro@v1.18.1-0.20200115213837-6562154573a0/router/table.go:184 +0x57f | |
github.com/micro/go-micro/router.(*router).Lookup(0xc0000fc960, 0xc00013a770, 0x1, 0x1, 0x273be90, 0xc00094c270, 0xc001344fc8, 0xaca7b9, 0x1940e60) | |
/go/pkg/mod/github.com/micro/go-micro@v1.18.1-0.20200115213837-6562154573a0/router/default.go:840 +0x54 | |
github.com/micro/micro/router/handler.(*Router).Lookup(0xc0002d0210, 0x1dd24c0, 0xc000f45900, 0xc000a72000, 0xc000f45ac0, 0xae7a0c, 0x1ab3cc0) |
Macro is for micro. Macro is a version of micro with ALL the plugins built in.
Many people seem to want a prebuilt version of micro with all the plugins. Or they just don't want to deal with the hassle of managing which plugins to add. Macro builds in all the plugins. Anything in go-plugins will be included in macro.
Micro is a runtime for microservice development.
Micro addresses the key requirements for building scalable systems. It takes the microservice architecture pattern and transforms it into a set of tools which act as the building blocks of a platform. Micro deals with the complexity of distributed systems and provides simple abstractions already understood by developers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
"github.com/micro/go-micro/registry" | |
) | |
func watch(r registry.Registry) { |