mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-06 16:40:32 +00:00
ci: auto release
This commit is contained in:
1 parent
936e193c20
commit
d3c5dafd3e
4 files changed
+115
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/monkeyWie/gopeed-core/pkg/base"
|
||||
"github.com/monkeyWie/gopeed-core/pkg/download"
|
||||
)
|
||||
|
||||
func main() {
|
||||
finallyCh := make(chan error)
|
||||
err := download.Boot().
|
||||
URL("https://www.baidu.com/index.html").
|
||||
Listener(func(event *download.Event) {
|
||||
if event.Key == download.EventKeyFinally {
|
||||
finallyCh <- event.Err
|
||||
}
|
||||
}).
|
||||
Create(&base.Options{
|
||||
Connections: 8,
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = <-finallyCh
|
||||
if err != nil {
|
||||
fmt.Printf("download fail:%v\n", err)
|
||||
} else {
|
||||
fmt.Println("download success")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user