services

package
v0.0.0-...-a0d3887 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthedUser = models.User{}

Functions

func ExtractUserFromJwt

func ExtractUserFromJwt(tokenString string) (models.User, error)

func GetPublicKey

func GetPublicKey() (string, error)

func GetPublicKeyBase64

func GetPublicKeyBase64() (string, error)

func KeysExist

func KeysExist() bool

func SendP2PMessage

func SendP2PMessage(message models.Message)

func SetUpKeys

func SetUpKeys() error

func SignMessage

func SignMessage(message models.Message) (models.Message, error)

func VerifyToken

func VerifyToken(tokenString string) error

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) SendSDPOffer

func (s *SnConnection) SendSDPOffer(destIp string)

ICE Senders

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL