Merge branch 'master' of ssh://github.com/asim/go-micro
This commit is contained in:
@@ -52,4 +52,4 @@ See [pkg.go.dev](https://pkg.go.dev/github.com/asim/go-micro/v3?tab=overview) fo
|
|||||||
|
|
||||||
## License
|
## 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).
|
||||||
|
|||||||
@@ -6,34 +6,6 @@ import (
|
|||||||
"github.com/micro/go-micro/v3/server"
|
"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
|
// Network is micro network
|
||||||
type Network interface {
|
type Network interface {
|
||||||
// Node is network node
|
// Node is network node
|
||||||
@@ -53,3 +25,31 @@ type Network interface {
|
|||||||
// Server is micro server
|
// Server is micro server
|
||||||
Server() server.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
|
||||||
|
}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ func TestResources(t *testing.T) {
|
|||||||
assert.Len(t, networkPolicy.AllowedLabels, 1)
|
assert.Len(t, networkPolicy.AllowedLabels, 1)
|
||||||
|
|
||||||
networkPolicy, err = NewNetworkPolicy("ingress", "test", map[string]string{"foo": "bar", "bar": "foo"})
|
networkPolicy, err = NewNetworkPolicy("ingress", "test", map[string]string{"foo": "bar", "bar": "foo"})
|
||||||
|
assert.NoError(t, err)
|
||||||
assert.Len(t, networkPolicy.AllowedLabels, 2)
|
assert.Len(t, networkPolicy.AllowedLabels, 2)
|
||||||
|
|
||||||
// Service:
|
// Service:
|
||||||
|
|||||||
Reference in New Issue
Block a user