diff --git a/client/auth_role.go b/client/auth_role.go index f410edbe0..72e801156 100644 --- a/client/auth_role.go +++ b/client/auth_role.go @@ -56,22 +56,22 @@ func NewAuthRoleAPI(c Client) AuthRoleAPI { } type AuthRoleAPI interface { - // Add a role. + // AddRole adds a role. AddRole(ctx context.Context, role string) error - // Remove a role. + // RemoveRole removes a role. RemoveRole(ctx context.Context, role string) error - // Get role details. + // GetRole retrieves role details. GetRole(ctx context.Context, role string) (*Role, error) - // Grant a role some permission prefixes for the KV store. + // GrantRoleKV grants a role some permission prefixes for the KV store. GrantRoleKV(ctx context.Context, role string, prefixes []string, permType PermissionType) (*Role, error) - // Revoke some some permission prefixes for a role on the KV store. + // RevokeRoleKV revokes some permission prefixes for a role on the KV store. RevokeRoleKV(ctx context.Context, role string, prefixes []string, permType PermissionType) (*Role, error) - // List roles. + // ListRoles lists roles. ListRoles(ctx context.Context) ([]string, error) } diff --git a/client/auth_user.go b/client/auth_user.go index 8c04baa34..336bd9f00 100644 --- a/client/auth_user.go +++ b/client/auth_user.go @@ -117,25 +117,25 @@ func NewAuthUserAPI(c Client) AuthUserAPI { } type AuthUserAPI interface { - // Add a user. + // AddUser adds a user. AddUser(ctx context.Context, username string, password string) error - // Remove a user. + // RemoveUser removes a user. RemoveUser(ctx context.Context, username string) error - // Get user details. + // GetUser retrieves user details. GetUser(ctx context.Context, username string) (*User, error) - // Grant a user some permission roles. + // GrantUser grants a user some permission roles. GrantUser(ctx context.Context, username string, roles []string) (*User, error) - // Revoke some permission roles from a user. + // RevokeUser revokes some permission roles from a user. RevokeUser(ctx context.Context, username string, roles []string) (*User, error) - // Change the user's password. + // ChangePassword changes the user's password. ChangePassword(ctx context.Context, username string, password string) (*User, error) - // List users. + // ListUsers lists the users. ListUsers(ctx context.Context) ([]string, error) } diff --git a/clientv3/kv.go b/clientv3/kv.go index 728de6a2f..b02420cf4 100644 --- a/clientv3/kv.go +++ b/clientv3/kv.go @@ -30,7 +30,7 @@ type ( ) type KV interface { - // PUT puts a key-value pair into etcd. + // Put puts a key-value pair into etcd. // Note that key,value can be plain bytes array and string is // an immutable representation of that bytes array. // To get a string of bytes, do string([]byte(0x10, 0x20)). diff --git a/clientv3/lease.go b/clientv3/lease.go index 2bd660558..1b896218a 100644 --- a/clientv3/lease.go +++ b/clientv3/lease.go @@ -49,8 +49,8 @@ type Lease interface { // should be used instead of KeepAliveOnce. KeepAliveOnce(ctx context.Context, id lease.LeaseID) (*LeaseKeepAliveResponse, error) - // Lease keeps internal routines and connections for efficient communication with etcd server. - // After using Lease, call Close() to release all related resources. + // Close releases all resources Lease keeps for efficient communication + // with the etcd server. Close() error } diff --git a/clientv3/sync/syncer.go b/clientv3/sync/syncer.go index 59bf95cbd..06c4007fd 100644 --- a/clientv3/sync/syncer.go +++ b/clientv3/sync/syncer.go @@ -28,7 +28,7 @@ type Syncer interface { // SyncBase syncs the base state of the key-value state. // The key-value state are sent through the returned chan. SyncBase(ctx context.Context) (<-chan clientv3.GetResponse, chan error) - // SyncBase syncs the updates of the key-value state. + // SyncUpdates syncs the updates of the key-value state. // The update events are sent through the returned chan. SyncUpdates(ctx context.Context) clientv3.WatchChan } diff --git a/etcdserver/cluster.go b/etcdserver/cluster.go index 6d0d60156..8284c998d 100644 --- a/etcdserver/cluster.go +++ b/etcdserver/cluster.go @@ -53,7 +53,7 @@ type Cluster interface { // IsIDRemoved checks whether the given ID has been removed from this // cluster at some point in the past IsIDRemoved(id types.ID) bool - // ClusterVersion is the cluster-wide minimum major.minor version. + // Version is the cluster-wide minimum major.minor version. Version() *semver.Version } diff --git a/etcdserver/member.go b/etcdserver/member.go index 0e5ea6a1f..5fddfb174 100644 --- a/etcdserver/member.go +++ b/etcdserver/member.go @@ -35,6 +35,7 @@ var ( // RaftAttributes represents the raft related attributes of an etcd member. type RaftAttributes struct { + // PeerURLs is the list of peers in the raft cluster. // TODO(philips): ensure these are URLs PeerURLs []string `json:"peerURLs"` } diff --git a/raft/node.go b/raft/node.go index caa547aca..bad91ddb1 100644 --- a/raft/node.go +++ b/raft/node.go @@ -153,7 +153,7 @@ type Node interface { ApplyConfChange(cc pb.ConfChange) *pb.ConfState // Status returns the current status of the raft state machine. Status() Status - // Report reports the given node is not reachable for the last send. + // ReportUnreachable reports the given node is not reachable for the last send. ReportUnreachable(id uint64) // ReportSnapshot reports the status of the sent snapshot. ReportSnapshot(id uint64, status SnapshotStatus) diff --git a/rafthttp/transport.go b/rafthttp/transport.go index 26a6b0403..b5c58af42 100644 --- a/rafthttp/transport.go +++ b/rafthttp/transport.go @@ -106,7 +106,7 @@ type Transport struct { // used to record transportation statistics with followers when // performing as leader in raft protocol LeaderStats *stats.LeaderStats - // error channel used to report detected critical error, e.g., + // ErrorC is used to report detected critical errors, e.g., // the member has been permanently removed from the cluster // When an error is received from ErrorC, user should stop raft state // machine and thus stop the Transport. diff --git a/storage/kv.go b/storage/kv.go index 9bcde9c86..cd63a354c 100644 --- a/storage/kv.go +++ b/storage/kv.go @@ -69,7 +69,7 @@ type KV interface { Compact(rev int64) error - // Get the hash of KV state. + // Hash retrieves the hash of KV state. // This method is designed for consistency checking purpose. Hash() (uint32, error)