mirror of https://github.com/status-im/consul.git
Start adding stuff
This commit is contained in:
parent
1585913fdf
commit
13f6cd376f
|
@ -0,0 +1,5 @@
|
|||
package consul
|
||||
|
||||
type Coordinate struct {
|
||||
srv *Server
|
||||
}
|
|
@ -144,13 +144,14 @@ type Server struct {
|
|||
|
||||
// Holds the RPC endpoints
|
||||
type endpoints struct {
|
||||
Catalog *Catalog
|
||||
Health *Health
|
||||
Status *Status
|
||||
KVS *KVS
|
||||
Session *Session
|
||||
Internal *Internal
|
||||
ACL *ACL
|
||||
Catalog *Catalog
|
||||
Health *Health
|
||||
Status *Status
|
||||
KVS *KVS
|
||||
Session *Session
|
||||
Internal *Internal
|
||||
ACL *ACL
|
||||
Coordinate *Coordinate
|
||||
}
|
||||
|
||||
// NewServer is used to construct a new Consul server from the
|
||||
|
@ -396,6 +397,7 @@ func (s *Server) setupRPC(tlsWrap tlsutil.DCWrapper) error {
|
|||
s.endpoints.Session = &Session{s}
|
||||
s.endpoints.Internal = &Internal{s}
|
||||
s.endpoints.ACL = &ACL{s}
|
||||
s.endpoints.Coordinate = &Coordinate{s}
|
||||
|
||||
// Register the handlers
|
||||
s.rpcServer.Register(s.endpoints.Status)
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/hashicorp/consul/acl"
|
||||
"github.com/hashicorp/go-msgpack/codec"
|
||||
"github.com/hashicorp/serf/coordinate"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -618,6 +619,21 @@ type ACLPolicy struct {
|
|||
QueryMeta
|
||||
}
|
||||
|
||||
// Coordinate stores a mapping from a node to its network coordinate
|
||||
type Coordinate struct {
|
||||
Node string
|
||||
Coord *coordinate.Coordinate
|
||||
}
|
||||
|
||||
type CoordinateGetRequest struct {
|
||||
Nodes []string
|
||||
}
|
||||
|
||||
type CoordinateUpdateRequest struct {
|
||||
Node string
|
||||
Coord *coordinate.Coordinate
|
||||
}
|
||||
|
||||
// EventFireRequest is used to ask a server to fire
|
||||
// a Serf event. It is a bit odd, since it doesn't depend on
|
||||
// the catalog or leader. Any node can respond, so it's not quite
|
||||
|
|
Loading…
Reference in New Issue