Merge branch 'master' of ssh://github.com/asim/go-micro

This commit is contained in:
Asim Aslam
2020-10-19 19:18:46 +01:00
3 changed files with 30 additions and 29 deletions

View File

@@ -52,4 +52,4 @@ See [pkg.go.dev](https://pkg.go.dev/github.com/asim/go-micro/v3?tab=overview) fo
## License
[Polyform Perimeter](https://polyformproject.org/licenses/perimeter/1.0.0/)
[Polyform Perimeter](https://polyformproject.org/licenses/perimeter/1.0.0/). To purchase a more permissive license contact [asim@micro.mu](mailto:asim@micro.mu).

View File

@@ -6,34 +6,6 @@ import (
"github.com/micro/go-micro/v3/server"
)
// Error is network node errors
type Error interface {
// Count is current count of errors
Count() int
// Msg is last error message
Msg() string
}
// Status is node status
type Status interface {
// Error reports error status
Error() Error
}
// Node is network node
type Node interface {
// Id is node id
Id() string
// Address is node bind address
Address() string
// Peers returns node peers
Peers() []Node
// Network is the network node is in
Network() Network
// Status returns node status
Status() Status
}
// Network is micro network
type Network interface {
// Node is network node
@@ -53,3 +25,31 @@ type Network interface {
// Server is micro server
Server() server.Server
}
// Node is network node
type Node interface {
// Id is node id
Id() string
// Address is node bind address
Address() string
// Peers returns node peers
Peers() []Node
// Network is the network node is in
Network() Network
// Status returns node status
Status() Status
}
// Error is network node errors
type Error interface {
// Count is current count of errors
Count() int
// Msg is last error message
Msg() string
}
// Status is node status
type Status interface {
// Error reports error status
Error() Error
}

View File

@@ -46,6 +46,7 @@ func TestResources(t *testing.T) {
assert.Len(t, networkPolicy.AllowedLabels, 1)
networkPolicy, err = NewNetworkPolicy("ingress", "test", map[string]string{"foo": "bar", "bar": "foo"})
assert.NoError(t, err)
assert.Len(t, networkPolicy.AllowedLabels, 2)
// Service: