This package helps you to write a golang application, which can be launched in Cocaine.
You can write application for Cocaine so fast and easy as you cannot even imagine.
Version | Refs |
---|---|
v0.12 | |
v0.11 |
Cocaine Go Framework
License: GNU Lesser General Public License v3.0
This package helps you to write a golang application, which can be launched in Cocaine.
You can write application for Cocaine so fast and easy as you cannot even imagine.
Version | Refs |
---|---|
v0.12 | |
v0.11 |
To return error from channle.Get() the payload must be checked according to a rx tree state.
Сейчас если что-нибудь произошло в приложении, то приложение просто крэшится и трейсбек показывает только внутренности фреймворка, хочется понятных трейсбэков =)
Sometimes I go from one app to other using Cocaine services. I need to interrupt the call in case if it lasts too long.
At line https://github.com/cocaine/cocaine-framework-go/blob/master/cocaine/asocket.go#L147
we should check count before error, cause
Callers should always process the n > 0 bytes returned before considering the error err. Doing so correctly handles I/O errors that happen after reading some bytes and also both of the allowed EOF behaviors.
http://golang.org/pkg/io/#Reader
I'd like to merge v0.12 into master branch, but it could affect v0.11 clients. I really don't want to use non native version systems like pkg.in. So propose to put both versions in the same repo, but in to different directories. Like cocaine11 & cocaine12. Any thoughts? We can get rid of cocaine11 later.
@m0sth8 @lamerman @mechmind
It seems like being able to specify http methods that are accepted by the handle is a useful feature. You can say it's supposed to handle GET requests only and whenever any other type of request appears it will return a correct HTTP response that says "Only GET method is supported".
Thus we loose logs, it would be cool to fix it.
For testing purposes we need to create proper cocaine.Request from given data and cocaine.Response with way to extract result (similar to functionality of httptest.ResponseRecorder).
Hi,
could you tell is it a bug or not. In your test
Now
var s string
var i int
res.Extract([]interface{}{&s, &i})
Want
var s string
var i int
res.ExtractTuple(&s, &i)
I'm using sample application:
package main
import (
"fmt"
"log"
"github.com/cocaine/cocaine-framework-go/cocaine"
)
func echo(request *cocaine.Request, response *cocaine.Response) {
inc := <-request.Read()
response.Write(inc)
response.Close()
}
func main() {
binds := map[string]cocaine.EventHandler{"echo": echo}
Worker, err := cocaine.NewWorker()
if err != nil {
log.Fatal(err)
}
Worker.Loop(binds)
}
Still this application timeouts while starting up.
Sample python application works nice, so looks like not a cocaine setup problem.
When i try to start my go cocaine(v0.11) app it fails with such message in crashlog: flag provided but not defined: -app
, as i can see the problem is in the argument parser from commit 3c87398
I think we could add CI tests, Travis CI for example. What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.