func handleTask(request *cocaine.Request, response *cocaine.Response) { defer response.Close() raw := <-request.Read() var task tasks.ParsingTask err := common.Unpack(raw, &task) if err != nil { response.ErrorMsg(-100, err.Error()) return } err = parsing.Parsing(ctxParsing, task) if err != nil { response.ErrorMsg(-100, err.Error()) } else { response.Write("OK") } }
func main() { t := parsing.Task{"imagick01g.photo.yandex.ru", "photo_proxy.json", "testgroup", 100, 400, "UNIQUEID"} log.Println(parsing.Parsing(t)) }