etcdserverpbconnect

package
v0.0.0-...-b668404 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KVName is the fully-qualified name of the KV service.
	KVName = "etcdserverpb.KV"
	// WatchName is the fully-qualified name of the Watch service.
	WatchName = "etcdserverpb.Watch"
	// LeaseName is the fully-qualified name of the Lease service.
	LeaseName = "etcdserverpb.Lease"
	// ClusterName is the fully-qualified name of the Cluster service.
	ClusterName = "etcdserverpb.Cluster"
	// MaintenanceName is the fully-qualified name of the Maintenance service.
	MaintenanceName = "etcdserverpb.Maintenance"
	// AuthName is the fully-qualified name of the Auth service.
	AuthName = "etcdserverpb.Auth"
)
View Source
const (
	// KVRangeProcedure is the fully-qualified name of the KV's Range RPC.
	KVRangeProcedure = "/etcdserverpb.KV/Range"
	// KVPutProcedure is the fully-qualified name of the KV's Put RPC.
	KVPutProcedure = "/etcdserverpb.KV/Put"
	// KVDeleteRangeProcedure is the fully-qualified name of the KV's DeleteRange RPC.
	KVDeleteRangeProcedure = "/etcdserverpb.KV/DeleteRange"
	// KVTxnProcedure is the fully-qualified name of the KV's Txn RPC.
	KVTxnProcedure = "/etcdserverpb.KV/Txn"
	// KVCompactProcedure is the fully-qualified name of the KV's Compact RPC.
	KVCompactProcedure = "/etcdserverpb.KV/Compact"
	// WatchWatchProcedure is the fully-qualified name of the Watch's Watch RPC.
	WatchWatchProcedure = "/etcdserverpb.Watch/Watch"
	// LeaseLeaseGrantProcedure is the fully-qualified name of the Lease's LeaseGrant RPC.
	LeaseLeaseGrantProcedure = "/etcdserverpb.Lease/LeaseGrant"
	// LeaseLeaseRevokeProcedure is the fully-qualified name of the Lease's LeaseRevoke RPC.
	LeaseLeaseRevokeProcedure = "/etcdserverpb.Lease/LeaseRevoke"
	// LeaseLeaseKeepAliveProcedure is the fully-qualified name of the Lease's LeaseKeepAlive RPC.
	LeaseLeaseKeepAliveProcedure = "/etcdserverpb.Lease/LeaseKeepAlive"
	// LeaseLeaseTimeToLiveProcedure is the fully-qualified name of the Lease's LeaseTimeToLive RPC.
	LeaseLeaseTimeToLiveProcedure = "/etcdserverpb.Lease/LeaseTimeToLive"
	// LeaseLeaseLeasesProcedure is the fully-qualified name of the Lease's LeaseLeases RPC.
	LeaseLeaseLeasesProcedure = "/etcdserverpb.Lease/LeaseLeases"
	// ClusterMemberAddProcedure is the fully-qualified name of the Cluster's MemberAdd RPC.
	ClusterMemberAddProcedure = "/etcdserverpb.Cluster/MemberAdd"
	// ClusterMemberRemoveProcedure is the fully-qualified name of the Cluster's MemberRemove RPC.
	ClusterMemberRemoveProcedure = "/etcdserverpb.Cluster/MemberRemove"
	// ClusterMemberUpdateProcedure is the fully-qualified name of the Cluster's MemberUpdate RPC.
	ClusterMemberUpdateProcedure = "/etcdserverpb.Cluster/MemberUpdate"
	// ClusterMemberListProcedure is the fully-qualified name of the Cluster's MemberList RPC.
	ClusterMemberListProcedure = "/etcdserverpb.Cluster/MemberList"
	// ClusterMemberPromoteProcedure is the fully-qualified name of the Cluster's MemberPromote RPC.
	ClusterMemberPromoteProcedure = "/etcdserverpb.Cluster/MemberPromote"
	// MaintenanceAlarmProcedure is the fully-qualified name of the Maintenance's Alarm RPC.
	MaintenanceAlarmProcedure = "/etcdserverpb.Maintenance/Alarm"
	// MaintenanceStatusProcedure is the fully-qualified name of the Maintenance's Status RPC.
	MaintenanceStatusProcedure = "/etcdserverpb.Maintenance/Status"
	// MaintenanceDefragmentProcedure is the fully-qualified name of the Maintenance's Defragment RPC.
	MaintenanceDefragmentProcedure = "/etcdserverpb.Maintenance/Defragment"
	// MaintenanceHashProcedure is the fully-qualified name of the Maintenance's Hash RPC.
	MaintenanceHashProcedure = "/etcdserverpb.Maintenance/Hash"
	// MaintenanceHashKVProcedure is the fully-qualified name of the Maintenance's HashKV RPC.
	MaintenanceHashKVProcedure = "/etcdserverpb.Maintenance/HashKV"
	// MaintenanceSnapshotProcedure is the fully-qualified name of the Maintenance's Snapshot RPC.
	MaintenanceSnapshotProcedure = "/etcdserverpb.Maintenance/Snapshot"
	// MaintenanceMoveLeaderProcedure is the fully-qualified name of the Maintenance's MoveLeader RPC.
	MaintenanceMoveLeaderProcedure = "/etcdserverpb.Maintenance/MoveLeader"
	// MaintenanceDowngradeProcedure is the fully-qualified name of the Maintenance's Downgrade RPC.
	MaintenanceDowngradeProcedure = "/etcdserverpb.Maintenance/Downgrade"
	// AuthAuthEnableProcedure is the fully-qualified name of the Auth's AuthEnable RPC.
	AuthAuthEnableProcedure = "/etcdserverpb.Auth/AuthEnable"
	// AuthAuthDisableProcedure is the fully-qualified name of the Auth's AuthDisable RPC.
	AuthAuthDisableProcedure = "/etcdserverpb.Auth/AuthDisable"
	// AuthAuthStatusProcedure is the fully-qualified name of the Auth's AuthStatus RPC.
	AuthAuthStatusProcedure = "/etcdserverpb.Auth/AuthStatus"
	// AuthAuthenticateProcedure is the fully-qualified name of the Auth's Authenticate RPC.
	AuthAuthenticateProcedure = "/etcdserverpb.Auth/Authenticate"
	// AuthUserAddProcedure is the fully-qualified name of the Auth's UserAdd RPC.
	AuthUserAddProcedure = "/etcdserverpb.Auth/UserAdd"
	// AuthUserGetProcedure is the fully-qualified name of the Auth's UserGet RPC.
	AuthUserGetProcedure = "/etcdserverpb.Auth/UserGet"
	// AuthUserListProcedure is the fully-qualified name of the Auth's UserList RPC.
	AuthUserListProcedure = "/etcdserverpb.Auth/UserList"
	// AuthUserDeleteProcedure is the fully-qualified name of the Auth's UserDelete RPC.
	AuthUserDeleteProcedure = "/etcdserverpb.Auth/UserDelete"
	// AuthUserChangePasswordProcedure is the fully-qualified name of the Auth's UserChangePassword RPC.
	AuthUserChangePasswordProcedure = "/etcdserverpb.Auth/UserChangePassword"
	// AuthUserGrantRoleProcedure is the fully-qualified name of the Auth's UserGrantRole RPC.
	AuthUserGrantRoleProcedure = "/etcdserverpb.Auth/UserGrantRole"
	// AuthUserRevokeRoleProcedure is the fully-qualified name of the Auth's UserRevokeRole RPC.
	AuthUserRevokeRoleProcedure = "/etcdserverpb.Auth/UserRevokeRole"
	// AuthRoleAddProcedure is the fully-qualified name of the Auth's RoleAdd RPC.
	AuthRoleAddProcedure = "/etcdserverpb.Auth/RoleAdd"
	// AuthRoleGetProcedure is the fully-qualified name of the Auth's RoleGet RPC.
	AuthRoleGetProcedure = "/etcdserverpb.Auth/RoleGet"
	// AuthRoleListProcedure is the fully-qualified name of the Auth's RoleList RPC.
	AuthRoleListProcedure = "/etcdserverpb.Auth/RoleList"
	// AuthRoleDeleteProcedure is the fully-qualified name of the Auth's RoleDelete RPC.
	AuthRoleDeleteProcedure = "/etcdserverpb.Auth/RoleDelete"
	// AuthRoleGrantPermissionProcedure is the fully-qualified name of the Auth's RoleGrantPermission
	// RPC.
	AuthRoleGrantPermissionProcedure = "/etcdserverpb.Auth/RoleGrantPermission"
	// AuthRoleRevokePermissionProcedure is the fully-qualified name of the Auth's RoleRevokePermission
	// RPC.
	AuthRoleRevokePermissionProcedure = "/etcdserverpb.Auth/RoleRevokePermission"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

Variables

This section is empty.

Functions

func NewAuthHandler

func NewAuthHandler(svc AuthHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewAuthHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewClusterHandler

func NewClusterHandler(svc ClusterHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewClusterHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewKVHandler

func NewKVHandler(svc KVHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewKVHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewLeaseHandler

func NewLeaseHandler(svc LeaseHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewLeaseHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewMaintenanceHandler

func NewMaintenanceHandler(svc MaintenanceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewMaintenanceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewWatchHandler

func NewWatchHandler(svc WatchHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewWatchHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type AuthClient

type AuthClient interface {
	// AuthEnable enables authentication.
	AuthEnable(context.Context, *connect.Request[etcdserverpb.AuthEnableRequest]) (*connect.Response[etcdserverpb.AuthEnableResponse], error)
	// AuthDisable disables authentication.
	AuthDisable(context.Context, *connect.Request[etcdserverpb.AuthDisableRequest]) (*connect.Response[etcdserverpb.AuthDisableResponse], error)
	// AuthStatus displays authentication status.
	AuthStatus(context.Context, *connect.Request[etcdserverpb.AuthStatusRequest]) (*connect.Response[etcdserverpb.AuthStatusResponse], error)
	// Authenticate processes an authenticate request.
	Authenticate(context.Context, *connect.Request[etcdserverpb.AuthenticateRequest]) (*connect.Response[etcdserverpb.AuthenticateResponse], error)
	// UserAdd adds a new user. User name cannot be empty.
	UserAdd(context.Context, *connect.Request[etcdserverpb.AuthUserAddRequest]) (*connect.Response[etcdserverpb.AuthUserAddResponse], error)
	// UserGet gets detailed user information.
	UserGet(context.Context, *connect.Request[etcdserverpb.AuthUserGetRequest]) (*connect.Response[etcdserverpb.AuthUserGetResponse], error)
	// UserList gets a list of all users.
	UserList(context.Context, *connect.Request[etcdserverpb.AuthUserListRequest]) (*connect.Response[etcdserverpb.AuthUserListResponse], error)
	// UserDelete deletes a specified user.
	UserDelete(context.Context, *connect.Request[etcdserverpb.AuthUserDeleteRequest]) (*connect.Response[etcdserverpb.AuthUserDeleteResponse], error)
	// UserChangePassword changes the password of a specified user.
	UserChangePassword(context.Context, *connect.Request[etcdserverpb.AuthUserChangePasswordRequest]) (*connect.Response[etcdserverpb.AuthUserChangePasswordResponse], error)
	// UserGrant grants a role to a specified user.
	UserGrantRole(context.Context, *connect.Request[etcdserverpb.AuthUserGrantRoleRequest]) (*connect.Response[etcdserverpb.AuthUserGrantRoleResponse], error)
	// UserRevokeRole revokes a role of specified user.
	UserRevokeRole(context.Context, *connect.Request[etcdserverpb.AuthUserRevokeRoleRequest]) (*connect.Response[etcdserverpb.AuthUserRevokeRoleResponse], error)
	// RoleAdd adds a new role. Role name cannot be empty.
	RoleAdd(context.Context, *connect.Request[etcdserverpb.AuthRoleAddRequest]) (*connect.Response[etcdserverpb.AuthRoleAddResponse], error)
	// RoleGet gets detailed role information.
	RoleGet(context.Context, *connect.Request[etcdserverpb.AuthRoleGetRequest]) (*connect.Response[etcdserverpb.AuthRoleGetResponse], error)
	// RoleList gets lists of all roles.
	RoleList(context.Context, *connect.Request[etcdserverpb.AuthRoleListRequest]) (*connect.Response[etcdserverpb.AuthRoleListResponse], error)
	// RoleDelete deletes a specified role.
	RoleDelete(context.Context, *connect.Request[etcdserverpb.AuthRoleDeleteRequest]) (*connect.Response[etcdserverpb.AuthRoleDeleteResponse], error)
	// RoleGrantPermission grants a permission of a specified key or range to a specified role.
	RoleGrantPermission(context.Context, *connect.Request[etcdserverpb.AuthRoleGrantPermissionRequest]) (*connect.Response[etcdserverpb.AuthRoleGrantPermissionResponse], error)
	// RoleRevokePermission revokes a key or range permission of a specified role.
	RoleRevokePermission(context.Context, *connect.Request[etcdserverpb.AuthRoleRevokePermissionRequest]) (*connect.Response[etcdserverpb.AuthRoleRevokePermissionResponse], error)
}

AuthClient is a client for the etcdserverpb.Auth service.

func NewAuthClient

func NewAuthClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthClient

NewAuthClient constructs a client for the etcdserverpb.Auth service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type AuthHandler

type AuthHandler interface {
	// AuthEnable enables authentication.
	AuthEnable(context.Context, *connect.Request[etcdserverpb.AuthEnableRequest]) (*connect.Response[etcdserverpb.AuthEnableResponse], error)
	// AuthDisable disables authentication.
	AuthDisable(context.Context, *connect.Request[etcdserverpb.AuthDisableRequest]) (*connect.Response[etcdserverpb.AuthDisableResponse], error)
	// AuthStatus displays authentication status.
	AuthStatus(context.Context, *connect.Request[etcdserverpb.AuthStatusRequest]) (*connect.Response[etcdserverpb.AuthStatusResponse], error)
	// Authenticate processes an authenticate request.
	Authenticate(context.Context, *connect.Request[etcdserverpb.AuthenticateRequest]) (*connect.Response[etcdserverpb.AuthenticateResponse], error)
	// UserAdd adds a new user. User name cannot be empty.
	UserAdd(context.Context, *connect.Request[etcdserverpb.AuthUserAddRequest]) (*connect.Response[etcdserverpb.AuthUserAddResponse], error)
	// UserGet gets detailed user information.
	UserGet(context.Context, *connect.Request[etcdserverpb.AuthUserGetRequest]) (*connect.Response[etcdserverpb.AuthUserGetResponse], error)
	// UserList gets a list of all users.
	UserList(context.Context, *connect.Request[etcdserverpb.AuthUserListRequest]) (*connect.Response[etcdserverpb.AuthUserListResponse], error)
	// UserDelete deletes a specified user.
	UserDelete(context.Context, *connect.Request[etcdserverpb.AuthUserDeleteRequest]) (*connect.Response[etcdserverpb.AuthUserDeleteResponse], error)
	// UserChangePassword changes the password of a specified user.
	UserChangePassword(context.Context, *connect.Request[etcdserverpb.AuthUserChangePasswordRequest]) (*connect.Response[etcdserverpb.AuthUserChangePasswordResponse], error)
	// UserGrant grants a role to a specified user.
	UserGrantRole(context.Context, *connect.Request[etcdserverpb.AuthUserGrantRoleRequest]) (*connect.Response[etcdserverpb.AuthUserGrantRoleResponse], error)
	// UserRevokeRole revokes a role of specified user.
	UserRevokeRole(context.Context, *connect.Request[etcdserverpb.AuthUserRevokeRoleRequest]) (*connect.Response[etcdserverpb.AuthUserRevokeRoleResponse], error)
	// RoleAdd adds a new role. Role name cannot be empty.
	RoleAdd(context.Context, *connect.Request[etcdserverpb.AuthRoleAddRequest]) (*connect.Response[etcdserverpb.AuthRoleAddResponse], error)
	// RoleGet gets detailed role information.
	RoleGet(context.Context, *connect.Request[etcdserverpb.AuthRoleGetRequest]) (*connect.Response[etcdserverpb.AuthRoleGetResponse], error)
	// RoleList gets lists of all roles.
	RoleList(context.Context, *connect.Request[etcdserverpb.AuthRoleListRequest]) (*connect.Response[etcdserverpb.AuthRoleListResponse], error)
	// RoleDelete deletes a specified role.
	RoleDelete(context.Context, *connect.Request[etcdserverpb.AuthRoleDeleteRequest]) (*connect.Response[etcdserverpb.AuthRoleDeleteResponse], error)
	// RoleGrantPermission grants a permission of a specified key or range to a specified role.
	RoleGrantPermission(context.Context, *connect.Request[etcdserverpb.AuthRoleGrantPermissionRequest]) (*connect.Response[etcdserverpb.AuthRoleGrantPermissionResponse], error)
	// RoleRevokePermission revokes a key or range permission of a specified role.
	RoleRevokePermission(context.Context, *connect.Request[etcdserverpb.AuthRoleRevokePermissionRequest]) (*connect.Response[etcdserverpb.AuthRoleRevokePermissionResponse], error)
}

AuthHandler is an implementation of the etcdserverpb.Auth service.

type ClusterClient

type ClusterClient interface {
	// MemberAdd adds a member into the cluster.
	MemberAdd(context.Context, *connect.Request[etcdserverpb.MemberAddRequest]) (*connect.Response[etcdserverpb.MemberAddResponse], error)
	// MemberRemove removes an existing member from the cluster.
	MemberRemove(context.Context, *connect.Request[etcdserverpb.MemberRemoveRequest]) (*connect.Response[etcdserverpb.MemberRemoveResponse], error)
	// MemberUpdate updates the member configuration.
	MemberUpdate(context.Context, *connect.Request[etcdserverpb.MemberUpdateRequest]) (*connect.Response[etcdserverpb.MemberUpdateResponse], error)
	// MemberList lists all the members in the cluster.
	MemberList(context.Context, *connect.Request[etcdserverpb.MemberListRequest]) (*connect.Response[etcdserverpb.MemberListResponse], error)
	// MemberPromote promotes a member from raft learner (non-voting) to raft voting member.
	MemberPromote(context.Context, *connect.Request[etcdserverpb.MemberPromoteRequest]) (*connect.Response[etcdserverpb.MemberPromoteResponse], error)
}

ClusterClient is a client for the etcdserverpb.Cluster service.

func NewClusterClient

func NewClusterClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ClusterClient

NewClusterClient constructs a client for the etcdserverpb.Cluster service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type ClusterHandler

type ClusterHandler interface {
	// MemberAdd adds a member into the cluster.
	MemberAdd(context.Context, *connect.Request[etcdserverpb.MemberAddRequest]) (*connect.Response[etcdserverpb.MemberAddResponse], error)
	// MemberRemove removes an existing member from the cluster.
	MemberRemove(context.Context, *connect.Request[etcdserverpb.MemberRemoveRequest]) (*connect.Response[etcdserverpb.MemberRemoveResponse], error)
	// MemberUpdate updates the member configuration.
	MemberUpdate(context.Context, *connect.Request[etcdserverpb.MemberUpdateRequest]) (*connect.Response[etcdserverpb.MemberUpdateResponse], error)
	// MemberList lists all the members in the cluster.
	MemberList(context.Context, *connect.Request[etcdserverpb.MemberListRequest]) (*connect.Response[etcdserverpb.MemberListResponse], error)
	// MemberPromote promotes a member from raft learner (non-voting) to raft voting member.
	MemberPromote(context.Context, *connect.Request[etcdserverpb.MemberPromoteRequest]) (*connect.Response[etcdserverpb.MemberPromoteResponse], error)
}

ClusterHandler is an implementation of the etcdserverpb.Cluster service.

type KVClient

type KVClient interface {
	// Range gets the keys in the range from the key-value store.
	Range(context.Context, *connect.Request[etcdserverpb.RangeRequest]) (*connect.Response[etcdserverpb.RangeResponse], error)
	// Put puts the given key into the key-value store.
	// A put request increments the revision of the key-value store
	// and generates one event in the event history.
	Put(context.Context, *connect.Request[etcdserverpb.PutRequest]) (*connect.Response[etcdserverpb.PutResponse], error)
	// DeleteRange deletes the given range from the key-value store.
	// A delete request increments the revision of the key-value store
	// and generates a delete event in the event history for every deleted key.
	DeleteRange(context.Context, *connect.Request[etcdserverpb.DeleteRangeRequest]) (*connect.Response[etcdserverpb.DeleteRangeResponse], error)
	// Txn processes multiple requests in a single transaction.
	// A txn request increments the revision of the key-value store
	// and generates events with the same revision for every completed request.
	// It is not allowed to modify the same key several times within one txn.
	Txn(context.Context, *connect.Request[etcdserverpb.TxnRequest]) (*connect.Response[etcdserverpb.TxnResponse], error)
	// Compact compacts the event history in the etcd key-value store. The key-value
	// store should be periodically compacted or the event history will continue to grow
	// indefinitely.
	Compact(context.Context, *connect.Request[etcdserverpb.CompactionRequest]) (*connect.Response[etcdserverpb.CompactionResponse], error)
}

KVClient is a client for the etcdserverpb.KV service.

func NewKVClient

func NewKVClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) KVClient

NewKVClient constructs a client for the etcdserverpb.KV service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type KVHandler

type KVHandler interface {
	// Range gets the keys in the range from the key-value store.
	Range(context.Context, *connect.Request[etcdserverpb.RangeRequest]) (*connect.Response[etcdserverpb.RangeResponse], error)
	// Put puts the given key into the key-value store.
	// A put request increments the revision of the key-value store
	// and generates one event in the event history.
	Put(context.Context, *connect.Request[etcdserverpb.PutRequest]) (*connect.Response[etcdserverpb.PutResponse], error)
	// DeleteRange deletes the given range from the key-value store.
	// A delete request increments the revision of the key-value store
	// and generates a delete event in the event history for every deleted key.
	DeleteRange(context.Context, *connect.Request[etcdserverpb.DeleteRangeRequest]) (*connect.Response[etcdserverpb.DeleteRangeResponse], error)
	// Txn processes multiple requests in a single transaction.
	// A txn request increments the revision of the key-value store
	// and generates events with the same revision for every completed request.
	// It is not allowed to modify the same key several times within one txn.
	Txn(context.Context, *connect.Request[etcdserverpb.TxnRequest]) (*connect.Response[etcdserverpb.TxnResponse], error)
	// Compact compacts the event history in the etcd key-value store. The key-value
	// store should be periodically compacted or the event history will continue to grow
	// indefinitely.
	Compact(context.Context, *connect.Request[etcdserverpb.CompactionRequest]) (*connect.Response[etcdserverpb.CompactionResponse], error)
}

KVHandler is an implementation of the etcdserverpb.KV service.

type LeaseClient

type LeaseClient interface {
	// LeaseGrant creates a lease which expires if the server does not receive a keepAlive
	// within a given time to live period. All keys attached to the lease will be expired and
	// deleted if the lease expires. Each expired key generates a delete event in the event history.
	LeaseGrant(context.Context, *connect.Request[etcdserverpb.LeaseGrantRequest]) (*connect.Response[etcdserverpb.LeaseGrantResponse], error)
	// LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
	LeaseRevoke(context.Context, *connect.Request[etcdserverpb.LeaseRevokeRequest]) (*connect.Response[etcdserverpb.LeaseRevokeResponse], error)
	// LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client
	// to the server and streaming keep alive responses from the server to the client.
	LeaseKeepAlive(context.Context) *connect.BidiStreamForClient[etcdserverpb.LeaseKeepAliveRequest, etcdserverpb.LeaseKeepAliveResponse]
	// LeaseTimeToLive retrieves lease information.
	LeaseTimeToLive(context.Context, *connect.Request[etcdserverpb.LeaseTimeToLiveRequest]) (*connect.Response[etcdserverpb.LeaseTimeToLiveResponse], error)
	// LeaseLeases lists all existing leases.
	LeaseLeases(context.Context, *connect.Request[etcdserverpb.LeaseLeasesRequest]) (*connect.Response[etcdserverpb.LeaseLeasesResponse], error)
}

LeaseClient is a client for the etcdserverpb.Lease service.

func NewLeaseClient

func NewLeaseClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) LeaseClient

NewLeaseClient constructs a client for the etcdserverpb.Lease service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type LeaseHandler

type LeaseHandler interface {
	// LeaseGrant creates a lease which expires if the server does not receive a keepAlive
	// within a given time to live period. All keys attached to the lease will be expired and
	// deleted if the lease expires. Each expired key generates a delete event in the event history.
	LeaseGrant(context.Context, *connect.Request[etcdserverpb.LeaseGrantRequest]) (*connect.Response[etcdserverpb.LeaseGrantResponse], error)
	// LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
	LeaseRevoke(context.Context, *connect.Request[etcdserverpb.LeaseRevokeRequest]) (*connect.Response[etcdserverpb.LeaseRevokeResponse], error)
	// LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client
	// to the server and streaming keep alive responses from the server to the client.
	LeaseKeepAlive(context.Context, *connect.BidiStream[etcdserverpb.LeaseKeepAliveRequest, etcdserverpb.LeaseKeepAliveResponse]) error
	// LeaseTimeToLive retrieves lease information.
	LeaseTimeToLive(context.Context, *connect.Request[etcdserverpb.LeaseTimeToLiveRequest]) (*connect.Response[etcdserverpb.LeaseTimeToLiveResponse], error)
	// LeaseLeases lists all existing leases.
	LeaseLeases(context.Context, *connect.Request[etcdserverpb.LeaseLeasesRequest]) (*connect.Response[etcdserverpb.LeaseLeasesResponse], error)
}

LeaseHandler is an implementation of the etcdserverpb.Lease service.

type MaintenanceClient

type MaintenanceClient interface {
	// Alarm activates, deactivates, and queries alarms regarding cluster health.
	Alarm(context.Context, *connect.Request[etcdserverpb.AlarmRequest]) (*connect.Response[etcdserverpb.AlarmResponse], error)
	// Status gets the status of the member.
	Status(context.Context, *connect.Request[etcdserverpb.StatusRequest]) (*connect.Response[etcdserverpb.StatusResponse], error)
	// Defragment defragments a member's backend database to recover storage space.
	Defragment(context.Context, *connect.Request[etcdserverpb.DefragmentRequest]) (*connect.Response[etcdserverpb.DefragmentResponse], error)
	// Hash computes the hash of whole backend keyspace,
	// including key, lease, and other buckets in storage.
	// This is designed for testing ONLY!
	// Do not rely on this in production with ongoing transactions,
	// since Hash operation does not hold MVCC locks.
	// Use "HashKV" API instead for "key" bucket consistency checks.
	Hash(context.Context, *connect.Request[etcdserverpb.HashRequest]) (*connect.Response[etcdserverpb.HashResponse], error)
	// HashKV computes the hash of all MVCC keys up to a given revision.
	// It only iterates "key" bucket in backend storage.
	HashKV(context.Context, *connect.Request[etcdserverpb.HashKVRequest]) (*connect.Response[etcdserverpb.HashKVResponse], error)
	// Snapshot sends a snapshot of the entire backend from a member over a stream to a client.
	Snapshot(context.Context, *connect.Request[etcdserverpb.SnapshotRequest]) (*connect.ServerStreamForClient[etcdserverpb.SnapshotResponse], error)
	// MoveLeader requests current leader node to transfer its leadership to transferee.
	MoveLeader(context.Context, *connect.Request[etcdserverpb.MoveLeaderRequest]) (*connect.Response[etcdserverpb.MoveLeaderResponse], error)
	// Downgrade requests downgrades, verifies feasibility or cancels downgrade
	// on the cluster version.
	// Supported since etcd 3.5.
	Downgrade(context.Context, *connect.Request[etcdserverpb.DowngradeRequest]) (*connect.Response[etcdserverpb.DowngradeResponse], error)
}

MaintenanceClient is a client for the etcdserverpb.Maintenance service.

func NewMaintenanceClient

func NewMaintenanceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MaintenanceClient

NewMaintenanceClient constructs a client for the etcdserverpb.Maintenance service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type MaintenanceHandler

type MaintenanceHandler interface {
	// Alarm activates, deactivates, and queries alarms regarding cluster health.
	Alarm(context.Context, *connect.Request[etcdserverpb.AlarmRequest]) (*connect.Response[etcdserverpb.AlarmResponse], error)
	// Status gets the status of the member.
	Status(context.Context, *connect.Request[etcdserverpb.StatusRequest]) (*connect.Response[etcdserverpb.StatusResponse], error)
	// Defragment defragments a member's backend database to recover storage space.
	Defragment(context.Context, *connect.Request[etcdserverpb.DefragmentRequest]) (*connect.Response[etcdserverpb.DefragmentResponse], error)
	// Hash computes the hash of whole backend keyspace,
	// including key, lease, and other buckets in storage.
	// This is designed for testing ONLY!
	// Do not rely on this in production with ongoing transactions,
	// since Hash operation does not hold MVCC locks.
	// Use "HashKV" API instead for "key" bucket consistency checks.
	Hash(context.Context, *connect.Request[etcdserverpb.HashRequest]) (*connect.Response[etcdserverpb.HashResponse], error)
	// HashKV computes the hash of all MVCC keys up to a given revision.
	// It only iterates "key" bucket in backend storage.
	HashKV(context.Context, *connect.Request[etcdserverpb.HashKVRequest]) (*connect.Response[etcdserverpb.HashKVResponse], error)
	// Snapshot sends a snapshot of the entire backend from a member over a stream to a client.
	Snapshot(context.Context, *connect.Request[etcdserverpb.SnapshotRequest], *connect.ServerStream[etcdserverpb.SnapshotResponse]) error
	// MoveLeader requests current leader node to transfer its leadership to transferee.
	MoveLeader(context.Context, *connect.Request[etcdserverpb.MoveLeaderRequest]) (*connect.Response[etcdserverpb.MoveLeaderResponse], error)
	// Downgrade requests downgrades, verifies feasibility or cancels downgrade
	// on the cluster version.
	// Supported since etcd 3.5.
	Downgrade(context.Context, *connect.Request[etcdserverpb.DowngradeRequest]) (*connect.Response[etcdserverpb.DowngradeResponse], error)
}

MaintenanceHandler is an implementation of the etcdserverpb.Maintenance service.

type UnimplementedAuthHandler

type UnimplementedAuthHandler struct{}

UnimplementedAuthHandler returns CodeUnimplemented from all methods.

type UnimplementedMaintenanceHandler

type UnimplementedMaintenanceHandler struct{}

UnimplementedMaintenanceHandler returns CodeUnimplemented from all methods.

type UnimplementedWatchHandler

type UnimplementedWatchHandler struct{}

UnimplementedWatchHandler returns CodeUnimplemented from all methods.

type WatchClient

type WatchClient interface {
	// Watch watches for events happening or that have happened. Both input and output
	// are streams; the input stream is for creating and canceling watchers and the output
	// stream sends events. One watch RPC can watch on multiple key ranges, streaming events
	// for several watches at once. The entire event history can be watched starting from the
	// last compaction revision.
	Watch(context.Context) *connect.BidiStreamForClient[etcdserverpb.WatchRequest, etcdserverpb.WatchResponse]
}

WatchClient is a client for the etcdserverpb.Watch service.

func NewWatchClient

func NewWatchClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) WatchClient

NewWatchClient constructs a client for the etcdserverpb.Watch service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type WatchHandler

type WatchHandler interface {
	// Watch watches for events happening or that have happened. Both input and output
	// are streams; the input stream is for creating and canceling watchers and the output
	// stream sends events. One watch RPC can watch on multiple key ranges, streaming events
	// for several watches at once. The entire event history can be watched starting from the
	// last compaction revision.
	Watch(context.Context, *connect.BidiStream[etcdserverpb.WatchRequest, etcdserverpb.WatchResponse]) error
}

WatchHandler is an implementation of the etcdserverpb.Watch service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL