var ErrMissingLeaderKey … type electionServer … func NewElectionServer(c *clientv3.Client) epb.ElectionServer { … } func (es *electionServer) Campaign(ctx context.Context, req *epb.CampaignRequest) (*epb.CampaignResponse, error) { … } func (es *electionServer) Proclaim(ctx context.Context, req *epb.ProclaimRequest) (*epb.ProclaimResponse, error) { … } func (es *electionServer) Observe(req *epb.LeaderRequest, stream epb.Election_ObserveServer) error { … } func (es *electionServer) Leader(ctx context.Context, req *epb.LeaderRequest) (*epb.LeaderResponse, error) { … } func (es *electionServer) Resign(ctx context.Context, req *epb.ResignRequest) (*epb.ResignResponse, error) { … } func (es *electionServer) session(ctx context.Context, lease int64) (*concurrency.Session, error) { … }