github.com/pion/dtls/v2@v2.2.12/session.go (about) 1 // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly> 2 // SPDX-License-Identifier: MIT 3 4 package dtls 5 6 // Session store data needed in resumption 7 type Session struct { 8 // ID store session id 9 ID []byte 10 // Secret store session master secret 11 Secret []byte 12 } 13 14 // SessionStore defines methods needed for session resumption. 15 type SessionStore interface { 16 // Set save a session. 17 // For client, use server name as key. 18 // For server, use session id. 19 Set(key []byte, s Session) error 20 // Get fetch a session. 21 Get(key []byte) (Session, error) 22 // Del clean saved session. 23 Del(key []byte) error 24 }