Documentation
¶
Index ¶
- Variables
- func ExtractUserFromJwt(tokenString string) (models.User, error)
- func GetPublicKey() (string, error)
- func GetPublicKeyBase64() (string, error)
- func KeysExist() bool
- func SendP2PMessage(message models.Message)
- func SetUpKeys() error
- func SignMessage(message models.Message) (models.Message, error)
- func VerifyToken(tokenString string) error
- type AuthService
- func (as *AuthService) LogInWithExistingJwt() error
- func (as *AuthService) LogOut() error
- func (as *AuthService) Login(email, password string) (*models.User, error)
- func (as *AuthService) Register(username, email, password string) (*map[string]interface{}, error)
- func (as *AuthService) SetContext(ctx context.Context)
- type MessagingHandler
- type SnConnection
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthedUser = models.User{}
Functions ¶
func GetPublicKey ¶
func GetPublicKeyBase64 ¶
func SendP2PMessage ¶
func VerifyToken ¶
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthSerivce ¶
func NewAuthSerivce(userRepo *repos.UserRepo, chatRepo *repos.ChatRepo, userchatRepo *repos.UserchatRepo, messageRepo *repos.MessageRepo, sn_con_handler *SnConnection) *AuthService
func (*AuthService) LogInWithExistingJwt ¶
func (as *AuthService) LogInWithExistingJwt() error
func (*AuthService) LogOut ¶
func (as *AuthService) LogOut() error
func (*AuthService) Login ¶
func (as *AuthService) Login(email, password string) (*models.User, error)
func (*AuthService) Register ¶
func (as *AuthService) Register(username, email, password string) (*map[string]interface{}, error)
func (*AuthService) SetContext ¶
func (as *AuthService) SetContext(ctx context.Context)
type MessagingHandler ¶
type MessagingHandler struct {
// contains filtered or unexported fields
}
func NewMessagingHandler ¶
func NewMessagingHandler(dataChannel *webrtc.DataChannel) *MessagingHandler
type SnConnection ¶
type SnConnection struct {
// contains filtered or unexported fields
}
func NewSnConnection ¶
func NewSnConnection() *SnConnection
func (*SnConnection) SetContext ¶
func (s *SnConnection) SetContext(ctx context.Context)
func (*SnConnection) SnConnectionHandler ¶
func (s *SnConnection) SnConnectionHandler()
p1p2, connects to the signaling server p1 creates and sends offer to the chosen peer p2 creates and sends answer to p1 p1 sends ICE candidates to p2 p2 replies with his ICE candidates datachannel is made
func (*SnConnection) UserSearchRequest ¶
func (s *SnConnection) UserSearchRequest(username string) (<-chan models.User, error)
! User search request sent to the sig server. The response is captured in the switch above.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.