*: fix godoc bugs in interfaces and slice fields

detected with goword
release-2.3
Anthony Romano 2016-02-24 00:45:40 -08:00
parent 783e6f6b0d
commit afa0368dcc
10 changed files with 22 additions and 21 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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"`
}

View File

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

View File

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

View File

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