mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4605 from heyitsanthony/fixup-godocs
*: fix godoc bugs in interfaces and slice fields
This commit is contained in:
commit
bbdff697db
@ -56,22 +56,22 @@ func NewAuthRoleAPI(c Client) AuthRoleAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AuthRoleAPI interface {
|
type AuthRoleAPI interface {
|
||||||
// Add a role.
|
// AddRole adds a role.
|
||||||
AddRole(ctx context.Context, role string) error
|
AddRole(ctx context.Context, role string) error
|
||||||
|
|
||||||
// Remove a role.
|
// RemoveRole removes a role.
|
||||||
RemoveRole(ctx context.Context, role string) error
|
RemoveRole(ctx context.Context, role string) error
|
||||||
|
|
||||||
// Get role details.
|
// GetRole retrieves role details.
|
||||||
GetRole(ctx context.Context, role string) (*Role, error)
|
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)
|
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)
|
RevokeRoleKV(ctx context.Context, role string, prefixes []string, permType PermissionType) (*Role, error)
|
||||||
|
|
||||||
// List roles.
|
// ListRoles lists roles.
|
||||||
ListRoles(ctx context.Context) ([]string, error)
|
ListRoles(ctx context.Context) ([]string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,25 +117,25 @@ func NewAuthUserAPI(c Client) AuthUserAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AuthUserAPI interface {
|
type AuthUserAPI interface {
|
||||||
// Add a user.
|
// AddUser adds a user.
|
||||||
AddUser(ctx context.Context, username string, password string) error
|
AddUser(ctx context.Context, username string, password string) error
|
||||||
|
|
||||||
// Remove a user.
|
// RemoveUser removes a user.
|
||||||
RemoveUser(ctx context.Context, username string) error
|
RemoveUser(ctx context.Context, username string) error
|
||||||
|
|
||||||
// Get user details.
|
// GetUser retrieves user details.
|
||||||
GetUser(ctx context.Context, username string) (*User, error)
|
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)
|
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)
|
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)
|
ChangePassword(ctx context.Context, username string, password string) (*User, error)
|
||||||
|
|
||||||
// List users.
|
// ListUsers lists the users.
|
||||||
ListUsers(ctx context.Context) ([]string, error)
|
ListUsers(ctx context.Context) ([]string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type KV interface {
|
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
|
// Note that key,value can be plain bytes array and string is
|
||||||
// an immutable representation of that bytes array.
|
// an immutable representation of that bytes array.
|
||||||
// To get a string of bytes, do string([]byte(0x10, 0x20)).
|
// To get a string of bytes, do string([]byte(0x10, 0x20)).
|
||||||
|
@ -49,8 +49,8 @@ type Lease interface {
|
|||||||
// should be used instead of KeepAliveOnce.
|
// should be used instead of KeepAliveOnce.
|
||||||
KeepAliveOnce(ctx context.Context, id lease.LeaseID) (*LeaseKeepAliveResponse, error)
|
KeepAliveOnce(ctx context.Context, id lease.LeaseID) (*LeaseKeepAliveResponse, error)
|
||||||
|
|
||||||
// Lease keeps internal routines and connections for efficient communication with etcd server.
|
// Close releases all resources Lease keeps for efficient communication
|
||||||
// After using Lease, call Close() to release all related resources.
|
// with the etcd server.
|
||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ type Syncer interface {
|
|||||||
// SyncBase syncs the base state of the key-value state.
|
// SyncBase syncs the base state of the key-value state.
|
||||||
// The key-value state are sent through the returned chan.
|
// The key-value state are sent through the returned chan.
|
||||||
SyncBase(ctx context.Context) (<-chan clientv3.GetResponse, chan error)
|
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.
|
// The update events are sent through the returned chan.
|
||||||
SyncUpdates(ctx context.Context) clientv3.WatchChan
|
SyncUpdates(ctx context.Context) clientv3.WatchChan
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ type Cluster interface {
|
|||||||
// IsIDRemoved checks whether the given ID has been removed from this
|
// IsIDRemoved checks whether the given ID has been removed from this
|
||||||
// cluster at some point in the past
|
// cluster at some point in the past
|
||||||
IsIDRemoved(id types.ID) bool
|
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
|
Version() *semver.Version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ var (
|
|||||||
|
|
||||||
// RaftAttributes represents the raft related attributes of an etcd member.
|
// RaftAttributes represents the raft related attributes of an etcd member.
|
||||||
type RaftAttributes struct {
|
type RaftAttributes struct {
|
||||||
|
// PeerURLs is the list of peers in the raft cluster.
|
||||||
// TODO(philips): ensure these are URLs
|
// TODO(philips): ensure these are URLs
|
||||||
PeerURLs []string `json:"peerURLs"`
|
PeerURLs []string `json:"peerURLs"`
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ type Node interface {
|
|||||||
ApplyConfChange(cc pb.ConfChange) *pb.ConfState
|
ApplyConfChange(cc pb.ConfChange) *pb.ConfState
|
||||||
// Status returns the current status of the raft state machine.
|
// Status returns the current status of the raft state machine.
|
||||||
Status() Status
|
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)
|
ReportUnreachable(id uint64)
|
||||||
// ReportSnapshot reports the status of the sent snapshot.
|
// ReportSnapshot reports the status of the sent snapshot.
|
||||||
ReportSnapshot(id uint64, status SnapshotStatus)
|
ReportSnapshot(id uint64, status SnapshotStatus)
|
||||||
|
@ -106,7 +106,7 @@ type Transport struct {
|
|||||||
// used to record transportation statistics with followers when
|
// used to record transportation statistics with followers when
|
||||||
// performing as leader in raft protocol
|
// performing as leader in raft protocol
|
||||||
LeaderStats *stats.LeaderStats
|
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
|
// the member has been permanently removed from the cluster
|
||||||
// When an error is received from ErrorC, user should stop raft state
|
// When an error is received from ErrorC, user should stop raft state
|
||||||
// machine and thus stop the Transport.
|
// machine and thus stop the Transport.
|
||||||
|
@ -69,7 +69,7 @@ type KV interface {
|
|||||||
|
|
||||||
Compact(rev int64) error
|
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.
|
// This method is designed for consistency checking purpose.
|
||||||
Hash() (uint32, error)
|
Hash() (uint32, error)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user