Session represents a lease kept alive for the lifetime of a client. Fault-tolerant applications may use sessions to reason about liveness.
| 28 | // Session represents a lease kept alive for the lifetime of a client. |
| 29 | // Fault-tolerant applications may use sessions to reason about liveness. |
| 30 | type Session struct { |
| 31 | client *v3.Client |
| 32 | opts *sessionOptions |
| 33 | id v3.LeaseID |
| 34 | |
| 35 | ctx context.Context |
| 36 | cancel context.CancelFunc |
| 37 | donec <-chan struct{} |
| 38 | } |
| 39 | |
| 40 | // NewSession gets the leased session for a client. |
| 41 | func NewSession(client *v3.Client, opts ...SessionOption) (*Session, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected