Start adding stuff

This commit is contained in:
Derek Chiang 2015-03-28 14:52:04 -04:00 committed by James Phillips
parent 3d33525b67
commit e54c8f2ea0
3 changed files with 30 additions and 7 deletions

View File

@ -0,0 +1,5 @@
package consul
type Coordinate struct {
srv *Server
}

View File

@ -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)

View File

@ -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