session.go 507 B

123456789101112131415161718192021
  1. package dtls
  2. // Session store data needed in resumption
  3. type Session struct {
  4. // ID store session id
  5. ID []byte
  6. // Secret store session master secret
  7. Secret []byte
  8. }
  9. // SessionStore defines methods needed for session resumption.
  10. type SessionStore interface {
  11. // Set save a session.
  12. // For client, use server name as key.
  13. // For server, use session id.
  14. Set(key []byte, s Session) error
  15. // Get fetch a session.
  16. Get(key []byte) (Session, error)
  17. // Del clean saved session.
  18. Del(key []byte) error
  19. }