Documentation
¶
Index ¶
- Variables
- func BatchInsertPhonebookEntries(ctx context.Context, entries []*PhonebookEntry) (int, int, error)
- func GetUserCapabilities(username string) (map[string]bool, error)
- func GetUserDisplayInfo(username string) (string, []string, error)
- func InitPersistence(dataDir string)
- func InitProfiles(profilesPath, usersPath string) error
- func LoadSessions() error
- func RemoveAllJWTTokens(username string) error
- func RemoveJWTToken(username, tokenToRemove string) error
- func RevokeLegacySession(username string, userSession *models.UserSession)
- func SaveSessions() error
- func UserSessionInit() map[string]*models.UserSession
- type PersistedSession
- type PhonebookEntry
- type ProfileData
- type ReloadStats
- type UserEndpoints
- type UserExtension
- type UserProfile
Constants ¶
This section is empty.
Variables ¶
var UserSessions map[string]*models.UserSession
Functions ¶
func BatchInsertPhonebookEntries ¶ added in v0.4.5
BatchInsertPhonebookEntries inserts multiple phonebook entries in a transaction.
func GetUserCapabilities ¶ added in v0.4.5
GetUserCapabilities returns all capabilities for a given username
func GetUserDisplayInfo ¶ added in v0.4.6
GetUserDisplayInfo returns display name and phone numbers for a given user.
func InitPersistence ¶ added in v0.4.0
func InitPersistence(dataDir string)
InitPersistence sets up the persistence file path
func InitProfiles ¶ added in v0.4.5
InitProfiles loads profiles and users from JSON files
func LoadSessions ¶ added in v0.4.0
func LoadSessions() error
LoadSessions loads user sessions from disk
func RemoveAllJWTTokens ¶ added in v0.4.0
func RemoveJWTToken ¶ added in v0.4.0
func RevokeLegacySession ¶ added in v0.4.0
func RevokeLegacySession(username string, userSession *models.UserSession)
RevokeLegacySession deletes the session entry and revokes legacy persistent token (subtype "user") Requires that userSession.JWTTokens is empty.
func UserSessionInit ¶
func UserSessionInit() map[string]*models.UserSession
Types ¶
type PersistedSession ¶ added in v0.4.0
type PersistedSession struct {
Username string `json:"username"`
JWTTokens []string `json:"jwt_tokens"`
NethCTIToken string `json:"nethcti_token"`
}
PersistedSession represents minimal session data needed for persistence
type PhonebookEntry ¶ added in v0.4.5
type PhonebookEntry struct {
ID int64
OwnerID string
Type string
HomeEmail string
WorkEmail string
HomePhone string
WorkPhone string
CellPhone string
Fax string
Title string
Company string
Notes string
Name string
HomeStreet string
HomePOB string
HomeCity string
HomeProvince string
HomePostalCode string
HomeCountry string
WorkStreet string
WorkPOB string
WorkCity string
WorkProvince string
WorkPostalCode string
WorkCountry string
URL string
Extension string
SpeedDialNum string
}
PhonebookEntry represents a phonebook contact from cti_phonebook table.
type ProfileData ¶ added in v0.4.5
ProfileData represents a profile with capability map
func GetUserProfile ¶ added in v0.4.5
func GetUserProfile(username string) (*ProfileData, error)
GetUserProfile returns the profile data for a given username
type ReloadStats ¶ added in v0.4.6
ReloadStats reports in-memory counters after a reload attempt.
func ReloadProfiles ¶ added in v0.4.5
func ReloadProfiles() (*ReloadStats, error)
ReloadProfiles reloads profiles and users and returns resulting counters.
type UserEndpoints ¶ added in v0.4.6
type UserEndpoints struct {
MainExtension map[string]struct{}
Extension map[string]*UserExtension
Voicemail map[string]struct{}
Email map[string]struct{}
Cellphone map[string]struct{}
}
UserEndpoints contains endpoint data loaded from users.json.
type UserExtension ¶ added in v0.4.6
UserExtension stores details for a single extension endpoint.
type UserProfile ¶ added in v0.4.5
type UserProfile struct {
Username string
Name string
ProfileID string
Endpoints UserEndpoints
PhoneNumbers []string
}
UserProfile links a username to a profile