package grpcproxy

import "go.etcd.io/etcd/server/v3/proxy/grpcproxy"

Package grpcproxy is an OSI level 7 proxy for etcd v3 API requests.

Index

Functions

func AuthStreamClientInterceptor

func AuthStreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

func AuthUnaryClientInterceptor

func AuthUnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

func DelRequestToOp

func DelRequestToOp(r *pb.DeleteRangeRequest) clientv3.Op

func HandleHealth

func HandleHealth(lg *zap.Logger, mux *http.ServeMux, c *clientv3.Client)

HandleHealth registers health handler on '/health'.

func HandleMetrics

func HandleMetrics(mux *http.ServeMux, c *http.Client, eps []string)

HandleMetrics performs a GET request against etcd endpoint and returns '/metrics'.

func HandleProxyHealth

func HandleProxyHealth(lg *zap.Logger, mux *http.ServeMux, c *clientv3.Client)

HandleProxyHealth registers health handler on '/proxy/health'.

func HandleProxyMetrics

func HandleProxyMetrics(mux *http.ServeMux)

HandleProxyMetrics registers metrics handler on '/proxy/metrics'.

func NewAuthProxy

func NewAuthProxy(c *clientv3.Client) pb.AuthServer

func NewClusterProxy

func NewClusterProxy(lg *zap.Logger, c *clientv3.Client, advaddr string, prefix string) (pb.ClusterServer, <-chan struct{})

NewClusterProxy takes optional prefix to fetch grpc-proxy member endpoints. The returned channel is closed when there is grpc-proxy endpoint registered and the client's context is canceled so the 'register' loop returns. TODO: Expand the API to report creation errors

func NewElectionProxy

func NewElectionProxy(client *clientv3.Client) v3electionpb.ElectionServer

func NewKvProxy

func NewKvProxy(c *clientv3.Client) (pb.KVServer, <-chan struct{})

func NewLeaseProxy

func NewLeaseProxy(ctx context.Context, c *clientv3.Client) (pb.LeaseServer, <-chan struct{})

func NewLockProxy

func NewLockProxy(client *clientv3.Client) v3lockpb.LockServer

func NewMaintenanceProxy

func NewMaintenanceProxy(c *clientv3.Client) pb.MaintenanceServer

func NewWatchProxy

func NewWatchProxy(ctx context.Context, lg *zap.Logger, c *clientv3.Client) (pb.WatchServer, <-chan struct{})

func PutRequestToOp

func PutRequestToOp(r *pb.PutRequest) clientv3.Op

func RangeRequestToOp

func RangeRequestToOp(r *pb.RangeRequest) clientv3.Op

func Register

func Register(lg *zap.Logger, c *clientv3.Client, prefix string, addr string, ttl int) <-chan struct{}

Register registers itself as a grpc-proxy server by writing prefixed-key with session of specified TTL (in seconds). The returned channel is closed when the client's context is canceled.

func TxnRequestToOp

func TxnRequestToOp(r *pb.TxnRequest) clientv3.Op

Types

type AuthProxy

type AuthProxy struct {
	// contains filtered or unexported fields
}

func (*AuthProxy) AuthDisable

func (*AuthProxy) AuthEnable

func (*AuthProxy) AuthStatus

func (*AuthProxy) Authenticate

func (*AuthProxy) RoleAdd

func (*AuthProxy) RoleDelete

func (*AuthProxy) RoleGet

func (*AuthProxy) RoleGrantPermission

func (*AuthProxy) RoleList

func (*AuthProxy) RoleRevokePermission

func (*AuthProxy) UserAdd

func (*AuthProxy) UserChangePassword

func (*AuthProxy) UserDelete

func (*AuthProxy) UserGet

func (*AuthProxy) UserGrantRole

func (*AuthProxy) UserList

func (*AuthProxy) UserRevokeRole

Source Files

auth.go cluster.go doc.go election.go health.go kv.go leader.go lease.go lock.go maintenance.go metrics.go register.go util.go watch.go watch_broadcast.go watch_broadcasts.go watch_ranges.go watcher.go

Directories

PathSynopsis
proxy/grpcproxy/adapterPackage adapter provides gRPC adapters between client and server gRPC interfaces without needing to go through a gRPC connection.
proxy/grpcproxy/cachePackage cache exports functionality for efficiently caching and mapping `RangeRequest`s to corresponding `RangeResponse`s.
Version
v3.5.18 (latest)
Published
Jan 24, 2025
Platform
linux/amd64
Imports
34 packages
Last checked
5 days ago

Tools for package owners.