瀏覽代碼

client: document Member fields

Brian Waldon 11 年之前
父節點
當前提交
39b5b083c0
共有 1 個文件被更改,包括 15 次插入6 次删除
  1. 15 6
      client/members.go

+ 15 - 6
client/members.go

@@ -32,9 +32,18 @@ var (
 )
 
 type Member struct {
-	ID         string   `json:"id"`
-	Name       string   `json:"name"`
-	PeerURLs   []string `json:"peerURLs"`
+	// ID is the unique identifier of this Member.
+	ID string `json:"id"`
+
+	// Name is a human-readable, non-unique identifier of this Member.
+	Name string `json:"name"`
+
+	// PeerURLs represents the HTTP(S) endpoints this Member uses to
+	// participate in etcd's consensus protocol.
+	PeerURLs []string `json:"peerURLs"`
+
+	// ClientURLs represents the HTTP(S) endpoints on which this Member
+	// serves it's client-facing APIs.
 	ClientURLs []string `json:"clientURLs"`
 }
 
@@ -85,13 +94,13 @@ func NewMembersAPI(c Client) MembersAPI {
 }
 
 type MembersAPI interface {
-	// List enumerates the current cluster membership
+	// List enumerates the current cluster membership.
 	List(ctx context.Context) ([]Member, error)
 
-	// Add instructs etcd to accept a new Member into the cluster
+	// Add instructs etcd to accept a new Member into the cluster.
 	Add(ctx context.Context, peerURL string) (*Member, error)
 
-	// Remove demotes an existing Member out of the cluster
+	// Remove demotes an existing Member out of the cluster.
 	Remove(ctx context.Context, mID string) error
 }