Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TimedHMAC ¶
type TimedHMAC struct {
// contains filtered or unexported fields
}
TimedHMAC generates a token with TTL and uses a pre-shared secret known to the relay server
func NewTimedHMAC ¶
NewTimedHMAC creates a new TimedHMAC instance
func (*TimedHMAC) GenerateToken ¶
GenerateToken generates new time-based secret token - basically Payload is a unix timestamp and Signature is a HMAC hash of a timestamp with a preshared TURN secret
type TimedHMACValidator ¶
type TimedHMACValidator struct {
*TimedHMAC
}
func NewTimedHMACValidator ¶
func NewTimedHMACValidator(secret string, duration time.Duration) *TimedHMACValidator
func (*TimedHMACValidator) Validate ¶
func (a *TimedHMACValidator) Validate(credentials any) error
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore is a simple in-memory store for token With this can update the token in thread safe way
func (*TokenStore) TokenBinary ¶
func (a *TokenStore) TokenBinary() []byte
func (*TokenStore) UpdateToken ¶
func (a *TokenStore) UpdateToken(token *Token) error
Click to show internal directories.
Click to hide internal directories.