func removeSharedFile(hash string) (err error) { err = readConfig() if err != nil { return } err = tcp.SendAndClose(*socketPort, []byte("RM::"+hash)) if err != nil { return } return }
func shareFile(filePath string) (err error) { err = readConfig() if err != nil { return } err = tcp.SendAndClose(*socketPort, []byte("SHARE::"+filePath)) if err != nil { return } pathHash := util.Encrypt(filePath, md.UserKey) fmt.Println(md.UserID + pathHash) return }