From d18819d1a51740b63d76da79a05721fd8955f35e Mon Sep 17 00:00:00 2001 From: godo Date: Fri, 6 Sep 2024 14:58:27 +0800 Subject: [PATCH] MIT License --- .../src/components/localchat/ChatEditor.vue | 8 +- frontend/src/stores/localchat.ts | 39 +-- godo/cmd/main.go | 28 +- godo/cmd/serve.go | 23 ++ godo/deps/frontend.go | 23 ++ godo/files/destop.go | 23 ++ godo/files/fs.go | 23 ++ godo/files/init.go | 23 ++ godo/files/os.go | 23 ++ godo/files/unzip.go | 23 ++ godo/files/watch.go | 23 ++ godo/files/zip.go | 23 ++ godo/libs/chatip.go | 25 +- godo/libs/config.go | 23 ++ godo/libs/dir.go | 23 ++ godo/libs/info.go | 23 ++ godo/libs/msg.go | 23 ++ godo/localchat/addr.go | 47 +++ godo/localchat/check.go | 47 +++ godo/localchat/file.go | 72 ++++- godo/localchat/image.go | 267 ++++++++++++++++++ godo/localchat/send.go | 23 ++ godo/localchat/server.go | 36 ++- godo/main.go | 23 ++ godo/store/checkactive.go | 23 ++ godo/store/cmds.go | 23 ++ godo/store/download.go | 23 ++ godo/store/install.go | 23 ++ godo/store/linux.go | 23 ++ godo/store/os.go | 24 +- godo/store/port.go | 23 ++ godo/store/progress.go | 23 ++ godo/store/start.go | 23 ++ godo/store/stop.go | 23 ++ godo/store/store.go | 23 ++ godo/store/types.go | 23 ++ godo/store/upload.go | 23 ++ godo/store/windows.go | 23 ++ godo/sys/msg.go | 23 ++ godo/sys/setting.go | 23 ++ godo/sys/update.go | 23 ++ godo/webdav/auth.go | 23 ++ godo/webdav/basicAuth.go | 23 ++ godo/webdav/client.go | 23 ++ godo/webdav/digestAuth.go | 23 ++ godo/webdav/errors.go | 23 ++ godo/webdav/file.go | 23 ++ godo/webdav/httpclient.go | 23 ++ godo/webdav/netrc.go | 23 ++ godo/webdav/passportAuth.go | 23 ++ godo/webdav/requests.go | 23 ++ godo/webdav/utils.go | 23 ++ 52 files changed, 1515 insertions(+), 44 deletions(-) create mode 100644 godo/localchat/image.go diff --git a/frontend/src/components/localchat/ChatEditor.vue b/frontend/src/components/localchat/ChatEditor.vue index 7528ac7..58aa9b0 100644 --- a/frontend/src/components/localchat/ChatEditor.vue +++ b/frontend/src/components/localchat/ChatEditor.vue @@ -48,10 +48,10 @@ const handleDrop = (event:any) => { } }; function send(){ - if(!store.hostInfo || !store.hostInfo.ip){ - notifyError("Please wait for a moment"); - return; - } + // if(!store.hostInfo || !store.hostInfo.ip){ + // notifyError("Please wait for a moment"); + // return; + // } store.sendMsg() } diff --git a/frontend/src/stores/localchat.ts b/frontend/src/stores/localchat.ts index 913d51d..dac373d 100644 --- a/frontend/src/stores/localchat.ts +++ b/frontend/src/stores/localchat.ts @@ -2,7 +2,7 @@ import { defineStore } from 'pinia' import emojiList from "@/assets/emoji.json" import { ref, toRaw, inject } from "vue"; import { db } from './db' -import { System, dirname } from "@/system"; +import { System } from "@/system"; import { getSystemConfig } from "@/system/config"; import { isBase64, base64ToBuffer } from "@/util/file"; import { isValidIP } from "@/util/common"; @@ -28,7 +28,7 @@ export const useLocalChatStore = defineStore('localChatStore', () => { const chatTargetIp = ref("") const showAddUser = ref(false) const handlerMessage = (data : any) => { - console.log(data) + //console.log(data) if(data.onlines){ const ips = [] for(let ip in data.onlines){ @@ -41,18 +41,18 @@ export const useLocalChatStore = defineStore('localChatStore', () => { } if(data.messages){ for(let ip in data.messages){ - const msgList:any = data.messages[ip].messages + const msgList:any = data.messages[ip] if(!msgList || msgList.length < 1)return; msgList.forEach((msg: any) => { //console.log(msg) if (msg.type === "text") { msg.message = msg.message.replaceAll("\\n", "\n") - console.log(msg) + //console.log(msg) addText(msg) } - //console.log(msg) - //console.log(msg.content) - //console.log(msg.content.length) + if (msg.type === "fileSending"){ + + } }) } } @@ -287,27 +287,10 @@ export const useLocalChatStore = defineStore('localChatStore', () => { //await getMsgList() await updateContentList(saveMsg) - if (config.storeType === 'browser') { - await storeFile(files) - } + handleSelect(1) } - const storeFile = async (fileList: any) => { - if (fileList.length < 1) return; - console.log(fileList) - for (let i = 0; i < fileList.length; i++) { - let content = fileList[i].content - if (typeof content === 'string') { - if (isBase64(content)) { - content = base64ToBuffer(content); - } - const path = dirname(fileList[i].path) - //console.log(path) - await sys?.fs.mkdir(path); - await sys?.fs.writeFile(fileList[i].path, content); - } - } - } + const getTargetUser = async (data: any) => { let targetUser: any = userList.value.find((d: any) => d.ip === data.ip) if (!targetUser) { @@ -341,7 +324,9 @@ export const useLocalChatStore = defineStore('localChatStore', () => { isRead: false, status: 'reciped' } - if (targetUser.id === chatTargetId.value) { + console.log(saveMsg) + console.log(chatTargetId.value) + if (targetUser.ip === chatTargetIp.value) { saveMsg.readAt = Date.now() saveMsg.isRead = true msgList.value.push(saveMsg) diff --git a/godo/cmd/main.go b/godo/cmd/main.go index d00334f8..e3a97bc 100644 --- a/godo/cmd/main.go +++ b/godo/cmd/main.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package cmd import ( @@ -80,7 +103,10 @@ func OsStart() { localchatRouter := router.PathPrefix("/localchat").Subrouter() localchatRouter.HandleFunc("/message", localchat.HandleMessage).Methods(http.MethodPost) - localchatRouter.HandleFunc("/file", localchat.HandlerFile).Methods(http.MethodPost) + localchatRouter.HandleFunc("/applyfile", localchat.HandlerApplySendFile).Methods(http.MethodPost) + localchatRouter.HandleFunc("/accessfile", localchat.HandlerAccessFile).Methods(http.MethodPost) + localchatRouter.HandleFunc("/sendimage", localchat.HandlerSendImg).Methods(http.MethodPost) + localchatRouter.HandleFunc("/viewimage", localchat.HandleViewImg).Methods(http.MethodPost) localchatRouter.HandleFunc("/setting", localchat.HandleAddr).Methods(http.MethodPost) localchatRouter.HandleFunc("/getsetting", localchat.HandleGetAddr).Methods(http.MethodGet) // 注册 WebDAV 路由 diff --git a/godo/cmd/serve.go b/godo/cmd/serve.go index e3113d6..4bfaac8 100644 --- a/godo/cmd/serve.go +++ b/godo/cmd/serve.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package cmd import ( diff --git a/godo/deps/frontend.go b/godo/deps/frontend.go index 5ae8944..b660711 100644 --- a/godo/deps/frontend.go +++ b/godo/deps/frontend.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package deps import "embed" diff --git a/godo/files/destop.go b/godo/files/destop.go index 45f9169..137ae9f 100644 --- a/godo/files/destop.go +++ b/godo/files/destop.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package files import ( diff --git a/godo/files/fs.go b/godo/files/fs.go index 38dd655..98f850d 100644 --- a/godo/files/fs.go +++ b/godo/files/fs.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package files import ( diff --git a/godo/files/init.go b/godo/files/init.go index c6bed54..f381b2b 100644 --- a/godo/files/init.go +++ b/godo/files/init.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package files import ( diff --git a/godo/files/os.go b/godo/files/os.go index 3dc66f6..0eaeeab 100644 --- a/godo/files/os.go +++ b/godo/files/os.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package files import ( diff --git a/godo/files/unzip.go b/godo/files/unzip.go index 01bd35e..f8bfff9 100644 --- a/godo/files/unzip.go +++ b/godo/files/unzip.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package files import ( diff --git a/godo/files/watch.go b/godo/files/watch.go index 442bea7..8bc8c96 100644 --- a/godo/files/watch.go +++ b/godo/files/watch.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package files import ( diff --git a/godo/files/zip.go b/godo/files/zip.go index 9f19125..74c5fb8 100644 --- a/godo/files/zip.go +++ b/godo/files/zip.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package files import ( diff --git a/godo/libs/chatip.go b/godo/libs/chatip.go index d2dfed2..50be288 100644 --- a/godo/libs/chatip.go +++ b/godo/libs/chatip.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package libs import ( @@ -23,7 +46,7 @@ func GetDefaultChatIpSetting() UserChatIpSetting { ThirdStart: "1", ThirdEnd: "1", FourthStart: "2", - FourthEnd: "99", + FourthEnd: "254", } } diff --git a/godo/libs/config.go b/godo/libs/config.go index b57a510..bbac28a 100644 --- a/godo/libs/config.go +++ b/godo/libs/config.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package libs import ( diff --git a/godo/libs/dir.go b/godo/libs/dir.go index b2b5fc4..8ee1ed7 100644 --- a/godo/libs/dir.go +++ b/godo/libs/dir.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package libs import ( diff --git a/godo/libs/info.go b/godo/libs/info.go index eb538c8..5daf3c0 100644 --- a/godo/libs/info.go +++ b/godo/libs/info.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package libs import ( diff --git a/godo/libs/msg.go b/godo/libs/msg.go index b98e3d8..97a76df 100644 --- a/godo/libs/msg.go +++ b/godo/libs/msg.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package libs import ( diff --git a/godo/localchat/addr.go b/godo/localchat/addr.go index 6ffe2d6..2536e78 100644 --- a/godo/localchat/addr.go +++ b/godo/localchat/addr.go @@ -1,3 +1,50 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package localchat import ( diff --git a/godo/localchat/check.go b/godo/localchat/check.go index 59d383e..eb7d1f6 100644 --- a/godo/localchat/check.go +++ b/godo/localchat/check.go @@ -1,3 +1,50 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package localchat import ( diff --git a/godo/localchat/file.go b/godo/localchat/file.go index d26e1a1..8b25af0 100644 --- a/godo/localchat/file.go +++ b/godo/localchat/file.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package localchat import ( @@ -25,7 +48,7 @@ type FileChunk struct { Filename string `json:"filename"` } -func HandlerFile(w http.ResponseWriter, r *http.Request) { +func HandlerApplySendFile(w http.ResponseWriter, r *http.Request) { var msg UdpMessage decoder := json.NewDecoder(r.Body) if err := decoder.Decode(&msg); err != nil { @@ -33,8 +56,6 @@ func HandlerFile(w http.ResponseWriter, r *http.Request) { return } defer r.Body.Close() - toIp := msg.IP - msg.Type = "file" hostname, err := os.Hostname() if err != nil { libs.ErrorMsg(w, "HandleMessage error") @@ -42,14 +63,49 @@ func HandlerFile(w http.ResponseWriter, r *http.Request) { } msg.Hostname = hostname msg.Time = time.Now() + msg.Type = "fileSending" + msg.Message = "" + SendToIP(msg) + libs.SuccessMsg(w, nil, "请求文件发送成功") +} +func HandlerAccessFile(w http.ResponseWriter, r *http.Request) { + var msg UdpMessage + decoder := json.NewDecoder(r.Body) + if err := decoder.Decode(&msg); err != nil { + http.Error(w, "Invalid request body", http.StatusBadRequest) + return + } + defer r.Body.Close() + hostname, err := os.Hostname() + if err != nil { + libs.ErrorMsg(w, "HandleMessage error") + return + } + msg.Hostname = hostname + msg.Time = time.Now() + msg.Type = "fileAccessed" + msg.Message = "" + SendToIP(msg) + libs.SuccessMsg(w, nil, "请求文件发送成功") +} +func HandlerSendFile(msg UdpMessage) { + toIp := msg.IP + hostname, err := os.Hostname() + if err != nil { + log.Printf("HandleMessage error: %v", err) + return + } + msg.Hostname = hostname + msg.Time = time.Now() + msg.Type = "file" basePath, err := libs.GetOsDir() if err != nil { - libs.HTTPError(w, http.StatusInternalServerError, err.Error()) + log.Printf("GetOsDir error: %v", err) return } paths, ok := msg.Message.([]string) if !ok { - libs.HTTPError(w, http.StatusInternalServerError, "Invalid request body") + log.Printf("invalid message type") return } for _, p := range paths { @@ -65,12 +121,10 @@ func HandlerFile(w http.ResponseWriter, r *http.Request) { continue } } - msg.Type = "text" - msg.Message = "文件发送完成" + msg.Type = "fileSended" + msg.Message = "" msg.Time = time.Now() SendToIP(msg) - libs.SuccessMsg(w, nil, "文件发送成功") - } func handleFile(filePath string, toIp string, message UdpMessage) { diff --git a/godo/localchat/image.go b/godo/localchat/image.go new file mode 100644 index 0000000..20804eb --- /dev/null +++ b/godo/localchat/image.go @@ -0,0 +1,267 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +package localchat + +import ( + "bytes" + "encoding/json" + "fmt" + "godo/libs" + "image" + "io" + "log" + "net" + "net/http" + "os" + "path/filepath" + "time" +) + +func HandlerSendImg(w http.ResponseWriter, r *http.Request) { + var msg UdpMessage + decoder := json.NewDecoder(r.Body) + if err := decoder.Decode(&msg); err != nil { + http.Error(w, "Invalid request body", http.StatusBadRequest) + return + } + defer r.Body.Close() + hostname, err := os.Hostname() + if err != nil { + libs.ErrorMsg(w, "HandleMessage error") + return + } + msg.Hostname = hostname + msg.Time = time.Now() + msg.Type = "image" + toIp := msg.IP + basePath, err := libs.GetOsDir() + if err != nil { + log.Printf("GetOsDir error: %v", err) + return + } + paths, ok := msg.Message.([]string) + if !ok { + log.Printf("invalid message type") + return + } + for _, p := range paths { + filePath := filepath.Join(basePath, p) + // 处理多张图片 + if fileInfo, err := os.Stat(filePath); err == nil { + if !fileInfo.IsDir() { + if isImage(filePath) { // 检查是否为图片 + sendImage(filePath, toIp, msg) + } else { + log.Printf("文件 %s 不是图片", filePath) + } + } + } else { + continue + } + } + libs.SuccessMsg(w, nil, "图片发送成功") +} +func isImage(filePath string) bool { + data, err := os.ReadFile(filePath) + if err != nil { + return false + } + img, _, err := image.DecodeConfig(bytes.NewReader(data)) + return err == nil && img.Width > 0 && img.Height > 0 +} +func sendImage(filePath string, toIp string, message UdpMessage) { + // 打开文件 + file, err := os.Open(filePath) + if err != nil { + log.Fatalf("Failed to open file: %v", err) + } + defer file.Close() + + // 获取文件大小 + fileInfo, err := file.Stat() + if err != nil { + log.Fatalf("Failed to get file info: %v", err) + } + fileSize := fileInfo.Size() + + // 读取整个文件 + data := make([]byte, fileSize) + _, err = file.Read(data) + if err != nil { + log.Fatalf("Failed to read file: %v", err) + } + + // 创建文件块 + chunk := FileChunk{ + Data: data, + Checksum: calculateChecksum(data), + Timestamp: time.Now(), + Filename: filepath.Base(file.Name()), + } + message.Message = chunk + // 将文件块转换为 JSON 格式 + data, err = json.Marshal(message) + if err != nil { + log.Fatalf("Failed to marshal chunk: %v", err) + } + + // 发送文件块 + port := "56780" + addr, err := net.ResolveUDPAddr("udp4", fmt.Sprintf("%s:%s", toIp, port)) + if err != nil { + log.Fatalf("Failed to resolve UDP address: %v", err) + } + + conn, err := net.DialUDP("udp4", nil, addr) + if err != nil { + log.Fatalf("Failed to dial UDP address: %v", err) + } + defer conn.Close() + + _, err = conn.Write(data) + if err != nil { + log.Printf("Failed to write data: %v", err) + } + + fmt.Printf("发送图片 %s 到 %s 成功\n", filePath, toIp) +} +func ReceiveImg(msg UdpMessage) (string, error) { + chunk := msg.Message.(FileChunk) + + // 验证校验和 + calculatedChecksum := calculateChecksum(chunk.Data) + if calculatedChecksum != chunk.Checksum { + fmt.Printf("Checksum mismatch for image from %s\n", msg.IP) + return "", fmt.Errorf("checksum mismatch") + } + + baseDir, err := libs.GetOsDir() + if err != nil { + log.Printf("Failed to get OS directory: %v", err) + return "", err + } + + // 创建接收文件的目录 + resPath := filepath.Join("C", "Users", "Reciv", time.Now().Format("2006-01-02")) + receiveDir := filepath.Join(baseDir, resPath) + if !libs.PathExists(receiveDir) { + err := os.MkdirAll(receiveDir, 0755) + if err != nil { + log.Printf("Failed to create receive directory: %v", err) + return "", err + } + } + + // 确定文件路径 + filePath := filepath.Join(receiveDir, chunk.Filename) + + // 如果文件不存在,则创建新文件 + if _, err := os.Stat(filePath); os.IsNotExist(err) { + file, err := os.Create(filePath) + if err != nil { + log.Printf("Failed to create file: %v", err) + return "", err + } + defer file.Close() + } + + // 打开或追加到现有文件 + file, err := os.OpenFile(filePath, os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + log.Printf("Failed to open file: %v", err) + return "", err + } + defer file.Close() + + // 写入数据 + _, err = file.Write(chunk.Data) + if err != nil { + log.Printf("Failed to write data to file: %v", err) + return "", err + } + + fmt.Printf("接收到图片 %s 从 %s 成功\n", filePath, msg.IP) + resFilePath := filepath.Join(resPath, chunk.Filename) + return resFilePath, nil +} +func HandleViewImg(w http.ResponseWriter, r *http.Request) { + img := r.URL.Query().Get("img") + if img == "" { + libs.ErrorMsg(w, "img is empty") + return + } + basePath, err := libs.GetOsDir() + if err != nil { + log.Printf("GetOsDir error: %v", err) + return + } + filePath := filepath.Join(basePath, img) + // 检查文件是否存在 + if _, err := os.Stat(filePath); os.IsNotExist(err) { + http.NotFound(w, r) + return + } + + // 设置正确的 MIME 类型 + mimeType, err := GetMimeType(filePath) + if err != nil { + http.Error(w, "Failed to determine MIME type", http.StatusInternalServerError) + return + } + + // 设置响应头 + w.Header().Set("Content-Type", mimeType) + + // 读取文件并写入响应体 + file, err := os.Open(filePath) + if err != nil { + http.Error(w, "Failed to open file", http.StatusInternalServerError) + return + } + defer file.Close() + + _, err = io.Copy(w, file) + if err != nil { + http.Error(w, "Failed to write file content", http.StatusInternalServerError) + return + } +} +func GetMimeType(filePath string) (string, error) { + f, err := os.Open(filePath) + if err != nil { + return "", err + } + defer f.Close() + + // 读取前 512 字节以确定 MIME 类型 + buffer := make([]byte, 512) + _, err = f.Read(buffer) + if err != nil { + return "", err + } + + mimeType := http.DetectContentType(buffer) + return mimeType, nil +} diff --git a/godo/localchat/send.go b/godo/localchat/send.go index 7500470..60e0dd8 100644 --- a/godo/localchat/send.go +++ b/godo/localchat/send.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package localchat import ( diff --git a/godo/localchat/server.go b/godo/localchat/server.go index f316bfa..0cd6b9d 100644 --- a/godo/localchat/server.go +++ b/godo/localchat/server.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package localchat import ( @@ -90,7 +113,18 @@ func UdpServer() { ReceiveFile(udpMsg) continue } - + if udpMsg.Type == "fileAccessed" { + HandlerSendFile(udpMsg) + continue + } + if udpMsg.Type == "image" { + filePath, err := ReceiveImg(udpMsg) + if err != nil { + log.Printf("error receiving image: %v", err) + continue + } + udpMsg.Message = filePath + } // 添加消息到 UserMessages AddMessage(udpMsg) } else { diff --git a/godo/main.go b/godo/main.go index 1613db4..24cf260 100644 --- a/godo/main.go +++ b/godo/main.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package main import "godo/cmd" diff --git a/godo/store/checkactive.go b/godo/store/checkactive.go index fbc74b6..a6a82e8 100644 --- a/godo/store/checkactive.go +++ b/godo/store/checkactive.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/cmds.go b/godo/store/cmds.go index 03c97f8..c13e0c4 100644 --- a/godo/store/cmds.go +++ b/godo/store/cmds.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/download.go b/godo/store/download.go index 34f5f21..6729731 100644 --- a/godo/store/download.go +++ b/godo/store/download.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/install.go b/godo/store/install.go index 13dd3b4..3283461 100644 --- a/godo/store/install.go +++ b/godo/store/install.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/linux.go b/godo/store/linux.go index d595898..709a279 100644 --- a/godo/store/linux.go +++ b/godo/store/linux.go @@ -1,5 +1,28 @@ //go:build !windows +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/os.go b/godo/store/os.go index 26a871a..72ff46c 100644 --- a/godo/store/os.go +++ b/godo/store/os.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( @@ -71,7 +94,6 @@ func DetectOperatingSystem() (name string, version string, err error) { return name, version, nil } -// DetectPackageManager returns the package manager based on the detected operating system. func DetectPackageManager() (pm string, err error) { switch runtime.GOOS { case "darwin": diff --git a/godo/store/port.go b/godo/store/port.go index 81c1f55..63389df 100644 --- a/godo/store/port.go +++ b/godo/store/port.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/progress.go b/godo/store/progress.go index 0391aa6..48d20e1 100644 --- a/godo/store/progress.go +++ b/godo/store/progress.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/start.go b/godo/store/start.go index 0f9609c..094d4a8 100644 --- a/godo/store/start.go +++ b/godo/store/start.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/stop.go b/godo/store/stop.go index 2986233..728eabc 100644 --- a/godo/store/stop.go +++ b/godo/store/stop.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/store.go b/godo/store/store.go index 6a34577..ed5528f 100644 --- a/godo/store/store.go +++ b/godo/store/store.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/types.go b/godo/store/types.go index 46ca8fb..a2b63ea 100644 --- a/godo/store/types.go +++ b/godo/store/types.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store // InstallInfo 描述了应用程序的安装信息。 diff --git a/godo/store/upload.go b/godo/store/upload.go index 33d080a..779d953 100644 --- a/godo/store/upload.go +++ b/godo/store/upload.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/store/windows.go b/godo/store/windows.go index 1f03a2a..31ceb99 100644 --- a/godo/store/windows.go +++ b/godo/store/windows.go @@ -1,6 +1,29 @@ //go:build windows // +build windows +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package store import ( diff --git a/godo/sys/msg.go b/godo/sys/msg.go index b6befd6..989ad41 100644 --- a/godo/sys/msg.go +++ b/godo/sys/msg.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package sys import ( diff --git a/godo/sys/setting.go b/godo/sys/setting.go index fa4c39b..47213f7 100644 --- a/godo/sys/setting.go +++ b/godo/sys/setting.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package sys import ( diff --git a/godo/sys/update.go b/godo/sys/update.go index a4c2769..16980bd 100644 --- a/godo/sys/update.go +++ b/godo/sys/update.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package sys import ( diff --git a/godo/webdav/auth.go b/godo/webdav/auth.go index 16815b4..66a1cb7 100644 --- a/godo/webdav/auth.go +++ b/godo/webdav/auth.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/basicAuth.go b/godo/webdav/basicAuth.go index fd8b4ea..4eb333b 100644 --- a/godo/webdav/basicAuth.go +++ b/godo/webdav/basicAuth.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/client.go b/godo/webdav/client.go index 1dc87fb..2608ded 100644 --- a/godo/webdav/client.go +++ b/godo/webdav/client.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/digestAuth.go b/godo/webdav/digestAuth.go index fbcfc29..007f993 100644 --- a/godo/webdav/digestAuth.go +++ b/godo/webdav/digestAuth.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/errors.go b/godo/webdav/errors.go index 8a78232..e4f0564 100644 --- a/godo/webdav/errors.go +++ b/godo/webdav/errors.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/file.go b/godo/webdav/file.go index 77880dc..5b1a7da 100644 --- a/godo/webdav/file.go +++ b/godo/webdav/file.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/httpclient.go b/godo/webdav/httpclient.go index 8b87fe0..f4eeb9f 100644 --- a/godo/webdav/httpclient.go +++ b/godo/webdav/httpclient.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/netrc.go b/godo/webdav/netrc.go index dc18f56..a0a1a90 100644 --- a/godo/webdav/netrc.go +++ b/godo/webdav/netrc.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/passportAuth.go b/godo/webdav/passportAuth.go index a2d7436..96dbd69 100644 --- a/godo/webdav/passportAuth.go +++ b/godo/webdav/passportAuth.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/requests.go b/godo/webdav/requests.go index 1c59369..bf00753 100644 --- a/godo/webdav/requests.go +++ b/godo/webdav/requests.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import ( diff --git a/godo/webdav/utils.go b/godo/webdav/utils.go index 9f97aa6..a306f49 100644 --- a/godo/webdav/utils.go +++ b/godo/webdav/utils.go @@ -1,3 +1,26 @@ +// MIT License +// +// Copyright (c) 2024 godoos.com +// Email: xpbb@qq.com +// GitHub: github.com/phpk/godoos +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. package webdav import (