package util
import "github.com/pion/dtls/v3/examples/util"
Package util provides auxiliary utilities used in examples
Index ¶
- func Chat(conn io.ReadWriter)
- func Check(err error)
- func LoadCertificate(path string) (*tls.Certificate, error)
- func LoadKeyAndCertificate(keyPath string, certificatePath string) (tls.Certificate, error)
- type Hub
Functions ¶
func Chat ¶
func Chat(conn io.ReadWriter)
Chat simulates a simple text chat session over the connection
func Check ¶
func Check(err error)
Check is a helper to throw errors in the examples
func LoadCertificate ¶
func LoadCertificate(path string) (*tls.Certificate, error)
LoadCertificate Load/read certificate(s) from file
func LoadKeyAndCertificate ¶
func LoadKeyAndCertificate(keyPath string, certificatePath string) (tls.Certificate, error)
LoadKeyAndCertificate reads certificates or key from file
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub is a helper to handle one to many chat
func NewHub ¶
func NewHub() *Hub
NewHub builds a new hub
func (*Hub) Chat ¶
func (h *Hub) Chat()
Chat starts the stdin readloop to dispatch messages to the hub
func (*Hub) Register ¶
Register adds a new conn to the Hub
Source Files ¶
- Version
- v3.0.4 (latest)
- Published
- Nov 4, 2024
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 1 week ago –
Tools for package owners.