Documentation
¶
Index ¶
- Constants
- Variables
- func AppendLogToFile(data *Log, filePath string) error
- func ComparePasswords(hashedPassword string, enteredPassword string) error
- func CreateWebClipboardFile() error
- func DownloadAllObjKeys(bucketName string, prefix string, region string) ([]string, error)
- func DownloadAndWriteNoteData() error
- func DownloadFile(bucketName string, objPath string, region string) ([]byte, error)
- func FileExists(filePath string) bool
- func HashPassword(password string) (string, error)
- func InitDirs()
- func InitFiles()
- func InitGlobalVars()
- func InitVars()
- func LogData(data string, logFilePath string)
- func S3_DownloadFiles() error
- type Client
- type ClientsMap
- type ErrorMessage
- type FTPayload
- type FT_MetaData_plusCONN
- type FT_Transfer
- type Log
- type Message
- type MetaDataFmt
- type S3_File
- type ServerError
- type SuccessMessage
- type UserProfile
- type UserRegister
Constants ¶
View Source
const ( C2A = "client-to-all" C2S = "client-to-server" S2C = "server-to-client" // Server to single client broadcast S2A = "server-to-all" // Global client broadcast )
View Source
const ( SERVER_ERR = 500 CLIENT_ERR = 400 )
View Source
const ( METADATA = "metadata" RECEIV_URL = "receiverURL" )
Variables ¶
View Source
var ( ChatClientsMap *ClientsMap = NewClientsMap() Id_Gen *id_Generator = &id_Generator{ start_ID: 0, } ConnUpgrader = websocket.Upgrader{} )
View Source
var ( PORT string REQUEST_LOG_PATH string SERVER_LOG_PATH string DUMMY_WS_LOG_PATH string CHAT_DEBUG string CHAT_LOG string CHAT_PASS string BUCKET_NAME string BUCKET_REGION string OBJ_RESUME_KEY string OBJ_RESUME_PNG_KEY string OBJ_RESUME_HTML_KEY string NOTES_DATA_FOLDER string LOCAL_INFO_PATH string LOCAL_RESUME_PATH string LOCAL_RESUME_PNG_PATH string LOCAL_RESUME_HTML_PATH string QUERY_GENERAL_PASS string QUERY_TRIGGER_PASS string DB_URL string DB_API_KEY string CLIPBOARD_PATH string )
View Source
var (
FT_Map = make(map[string]*FT_Transfer)
)
View Source
var (
S3_Files = []S3_File{}
)
Functions ¶
func AppendLogToFile ¶
func ComparePasswords ¶
func CreateWebClipboardFile ¶
func CreateWebClipboardFile() error
func DownloadAllObjKeys ¶
func DownloadAndWriteNoteData ¶
func DownloadAndWriteNoteData() error
func DownloadFile ¶
Download the resource file from the given s3 bucket
func FileExists ¶
func HashPassword ¶
func InitGlobalVars ¶
func InitGlobalVars()
func S3_DownloadFiles ¶
func S3_DownloadFiles() error
Types ¶
type ClientsMap ¶
func NewClientsMap ¶
func NewClientsMap() *ClientsMap
func (*ClientsMap) AddClient ¶
func (c *ClientsMap) AddClient(clientID string, client *Client)
func (*ClientsMap) DeleteClient ¶
func (c *ClientsMap) DeleteClient(clientID string)
func (*ClientsMap) GetClientsStr ¶
func (c *ClientsMap) GetClientsStr() string
Returns a string of all the online clients
type ErrorMessage ¶
func ClientErr ¶
func ClientErr(messageStr string) ErrorMessage
func InternalServerErr ¶
func InternalServerErr(messageStr string) ErrorMessage
func (*ErrorMessage) Error ¶
func (e *ErrorMessage) Error() string
type FT_MetaData_plusCONN ¶
type FT_MetaData_plusCONN struct { ReceiverUrl string ConnID string Filename string FileByteSize int64 ReceiverConn *websocket.Conn SenderConn *websocket.Conn }
All of the metadata recerverURL, connID, filename, fileByteSize
type FT_Transfer ¶
type MetaDataFmt ¶
type ServerError ¶
Custom Server Error
func (*ServerError) Error ¶
func (ce *ServerError) Error() string
type SuccessMessage ¶
type SuccessMessage struct {
Message string `json:"message"`
}
type UserProfile ¶
type UserProfile struct { Id int `json:"id"` Username string `json:"username"` Password string `json:"password"` Email string `json:"email"` }
func GetUserFromEmail ¶
func GetUserFromEmail(email string) ([]UserProfile, error)
Returns user array given the email. If the provided email not in the db, returns an empty array. This allows to check whether the user exists or no. Remember to account for offline db server.
type UserRegister ¶
type UserRegister struct { Username string `json:"username"` Password string `json:"password"` Email string `json:"email"` }
The Id in UserProfile defaults to 0 which results in a conflict
Click to show internal directories.
Click to hide internal directories.