Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uk0/httpwatcher
http watch on
https://github.com/uk0/httpwatcher
Last synced: about 11 hours ago
JSON representation
http watch on
- Host: GitHub
- URL: https://github.com/uk0/httpwatcher
- Owner: uk0
- Created: 2019-04-29T14:24:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-08T08:12:55.000Z (over 5 years ago)
- Last Synced: 2023-03-03T19:58:22.482Z (over 1 year ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# httpWatcher
http watch on```golang
package mainimport (
"bufio"
"fmt"
"github.com/astaxie/beego/logs"
"github.com/nahid/gohttp"
"github.com/rs/xid"
"io"
"os"
"strings"
"time"
)
var MiniBatch = 256;
var outTime int64 = 9;
var start = 0;var (
HttpWatcher *WatchClient
)
var WatchThreadNum = 1;
var ticker = time.NewTicker(time.Duration(outTime) * time.Second) // --- A
type MessageWatcher struct {
start int
offset int
}type WatchClient struct {
url string
lineHttpChan chan *MessageWatcher
}var chHttp = make(chan *gohttp.AsyncResponse,100)
func NewHttpWatcher( address string) (afk *WatchClient, err error) {
afk = &WatchClient{
lineHttpChan:make(chan *MessageWatcher,10),
}
if err != nil {
fmt.Printf("Failed to create Connetcion: %s\n", err)
os.Exit(1)
}
afk.url = address;
for i:=0;i