[go-nuts] Re: A simple and effective Golang web framework

2016-09-27 Thread Devashish Ghosh
https://github.com/jabong/florest-core A lightweight workflow based REST 
API framework with features customized workflow, logging, monitoring, a/b 
test, dynamic config, profiling, swagger, database adapters, cache adapter.


On Saturday, August 24, 2013 at 12:32:48 PM UTC+5:30, Tom wrote:
>
> Hi,
>
> I started meddling around with Go and I realized I really want to use it 
> as a server language. However there's no easy way to create a seamless 
> setup like you can with PHP and Apache or Ruby on Rails etc. Now I know 
> that Go is different because it's compiled and it's not a scripting 
> language but is there any good way to get a setup similar to that. Where I 
> could have server side .go files that get executed? For now I came up with 
> a hackish solution that puts together the code on compile: 
> https://github.com/tombousso/GoServe. It's definitely not an ideal 
> solution. Any better ideas or ideas for improving what I have?
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Web Framework

2016-09-27 Thread Devashish Ghosh
https://github.com/jabong/florest-core A lightweight workflow based REST 
API framework with features like customized workflow, logging, monitoring, 
a/b test, dynamic config, profiling, swagger, database adapters, cache 
adapter.


On Sunday, June 24, 2012 at 4:35:41 PM UTC+5:30, Max wrote:
>
> What web framework do you use your self?
>
> Do you create webapps in Go?
>
> Is it good idea to create web apps with Go now?
>
> Web Framework do you use? I would love to have option to update some page 
> dynamically without server restart.
> Looks like I have to proxy this pages to some other server or use FCGI.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Which web framework is recommended to use with GO?

2016-09-27 Thread Devashish Ghosh
https://github.com/jabong/florest-core A lightweight workflow based REST 
API framework with features customized workflow, logging, monitoring, a/b 
test, dynamic config, profiling, swagger, database adapters, cache adapter.

On Saturday, January 17, 2015 at 4:30:07 PM UTC+5:30, Subhajit Datta wrote:
>
> Hi,
> As of now, there seems to be many web frameworks in GO found on GITHUB 
> projects.
> eg:
> webgo, gorrila, martini, Goji, Negorini, Revel, Beego
> It will be really helpful if the community can suggest the good frameworks 
> from these.
> I am a newbie to GO.
> Also please provide the pros and cons for the framework/s that you have 
> used.
>
> Thanks and Regards,
> Subhajit Datta
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Why result type is different on sql.Query()

2016-09-27 Thread Harry
I mention about the below func of ```database/sql``` package and I'm using 
golang 1.7.

func (db *DB) Query(query string, args ...interface{}) (*Rows, error) {...}


I'm using MySQL and handling query result like that code below, (there are 
some omissions.)


sql := "SELECT field1, field2 FROM t_xxx WHERE flg=?"
//1-1) added args parameter 
rows, err := ms.DB.Query(sql, 1)

values := make([]interface{}, 2)
scanArgs := make([]interface{}, 2)
for i := range values {
 scanArgs[i] = &values[i]
}

err = rows.Scan(scanArgs...)

//1-2) I expect that type of field1 is int64
val := reflect.ValueOf(values[0])
//val.Kind()==reflect.Int64


//--
//Next check
//--

//2-1) no args parameter 
rows1, err := ms.DB.Query(sql)

values2 := make([]interface{}, 2)
scanArgs2 := make([]interface{}, 2)
for i := range values2 {
 scanArgs2[i] = &values2[i]
}

err = rows2.Scan(scanArgs2...)

//2-2) I expect that type of field1 is int64
val := reflect.ValueOf(values2[0])
//But, result was not int, it was byte. and it can be asseted as string.
//val.Kind()==reflect.Slice ([]uint8)


When adding args to Query func, result type is OK, but without it, result 
type change into []byte.

Why, result type changed???



Thank you.

Harry

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] go/types - creating a Type from whole cloth?

2016-09-27 Thread Ian Lance Taylor
On Tue, Sep 27, 2016 at 9:20 PM, Nate Finch  wrote:
> I want to, for example, compare a Type from code I'm ingesting to see if
> it's a *bytes.Buffer   is there a way I can make my own Type from a
> value or type definition in my code so that I can compare the two Types?  Or
> do I have to do something ugly like comparing the String() output of the
> Type to "*bytes.Buffer" ?

I'm not clear on what you are starting with.  Can you just write
if _, ok := v.(*bytes.Buffer); ok {
fmt.Println("it's *bytes.Buffer")
}

You can construct some types using, e.g., reflect.PtrTo, but you can't
construct a named type like bytes.Buffer.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] go/types - creating a Type from whole cloth?

2016-09-27 Thread Nate Finch
I want to, for example, compare a Type from code I'm ingesting to see if 
it's a *bytes.Buffer   is there a way I can make my own Type from a 
value or type definition in my code so that I can compare the two Types? 
 Or do I have to do something ugly like comparing the String() output of 
the Type to "*bytes.Buffer" ?

-Nate

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] json inline

2016-09-27 Thread Matt Harden
I think what they are saying there is that the `,inline` tag part is
ignored by the JSON encoding and decoding software, and it's just there for
documentation - to remind humans that the struct will be inlined in the
resulting JSON. The reason the struct is inlined is because it is an
"anonymous struct field". This is explained in the doc for Marshal in
encoding/json.

"Anonymous struct fields are usually marshaled as if their inner exported
fields were fields in the outer struct, subject to the usual Go visibility
rules amended as described in the next paragraph."

On Tue, Sep 27, 2016 at 2:22 PM Nick Leli  wrote:

> After inspecting some Kubernetes code
> ,
> I see the json `inline` used throughout to create persistent structs.  This
> topic appears to be a proposal
>  from a
> few years ago, yet I don't see any public documentation on the matter, just
> a reference
> 
> to Google having the documentation.  Is there any public documentation I am
> not seeing?
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] type-embeded consts and variables request

2016-09-27 Thread Ian Lance Taylor
On Tue, Sep 27, 2016 at 5:08 PM, Ally  Dale  wrote:
>
> The puzzle I have face to is that I HAVE TO create a new Duration type, and
> HAVE TO inherit all methods and constants from std.time.Duration.

Well, then, you have to replicate all the constants and methods.  The
methods on your new type can call the methods on time.Duration.  You
can write the constants directly.

But this sounds like an XY problem.  Why do you have to create a new
Duration type?

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] getting method comments from a package

2016-09-27 Thread Dan Kortschak
Thanks.

On Tue, 2016-09-27 at 11:35 +0100, roger peppe wrote:
> A slightly different problem, but you might be interested
> in this code that I use to find the doc comment for a method
> that's been discovered through go/types:
> 
> https://play.golang.org/p/POH1FwOCsZ


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] type-embeded consts and variables request

2016-09-27 Thread Ally Dale
Thanks for replying.
But I'm sorry for perhaps I haven't describ clear enough.
The puzzle I have face to is that I HAVE TO create a new Duration type, and 
HAVE TO inherit all methods and constants from std.time.Duration.
Because my DEMAND is to inherit and expand std.time.Duration and to hide 
std.time.Duration for clients due to the follow limits:
// compile error: cannot define new methods on non-local type time.Duration
func (d time.Duration) Days() float64 {
 return float64(d) / float64(Day)
}

I have uploading my code and test case here:
https://github.com/vipally/gx/blob/master/time/duration.go
https://github.com/vipally/gx/blob/master/time/duration_test.go

Could you check and give me some optimize suggestion?
Yet I have finish my demand in my own way, but I feel it not good enough 
but I have no more ideas about this:
//re-export std.Duration.consts
 const(
Nanosecond Duration = Duration(time.Nanosecond)
...
)
//re-export std.Duration.methods
//re-export std.Duration.Seconds
func (d Duration) Seconds() float64 {
 return d.Std().Seconds()
}

So I have printed this topic to report my difficulty on this case by 
golang, and hope to get some advises from go authors team.
Thanks again.

在 2016年9月26日星期一 UTC+8下午7:50:30,Axel Wagner写道:
>
> I think you are overcomplicating things for yourself. Just use the 
> solution Jan has provided. If you don't want people to need to import time 
> additionally, re-export the constants from your own package. No need to 
> define a new type.
>
> On Mon, Sep 26, 2016 at 11:17 AM, Ally Dale  > wrote:
>
>> In final words, the KEY problem of my topic is:
>> It's easy to extending exists public types by redefine or use struct's 
>> no-name embeding in Golang.
>> The new types will inherit all data and public methods from the old 
>> package. 
>>
> But there is NO WAYS to inherit public consts and variables defined from 
>> old package.
>>
>
> I don't understand what you mean by this. You can simply do
>
> const Foo = somepackage.Foo
>
> go get a constant in your package of the same type and value as the one 
> from another package. Constants aren't bound to any type, they *have* a 
> type. The type doesn't "know" what constants you define with it, just as 
> variables don't know it. As such, talking about "inheriting constants or 
> variables" doesn't make a lot of sense, they have nothing to do with types.
>
> So I wonder if Go authors can explain how can we achieve this demand.
>>
>
> I am not sure there really *is* a demand. You presented a problem and have 
> been given a solution. I don't understand why you think that solution isn't 
> good enough.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: dialing a name with multiple addresses

2016-09-27 Thread anmol via golang-nuts
I understand now. If the first IP fails, it uses the next one and so on 
until it runs out of IPs or the timeout occurs.

On Tuesday, September 27, 2016 at 5:23:18 PM UTC-4, Anmol Sethi wrote:
>
> For https://godoc.org/net#Dialer , it says "When dialing a name with 
> multiple IP addresses, the timeout may be divided between them." 
>
> Why? Wouldn't the name still be resolved to a single IP?
>
> E.g. if I have 5 IPs for example.com, one would be selected and used. Why 
> would the timeout need to be divided among them?
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Set ldflags for vendor dependency

2016-09-27 Thread mhhcbon
What if for some reason i have to write the value like this within the code 
(...),

var SomeVariable = "some"+"what"

ldflags will be able to operate ?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] json inline

2016-09-27 Thread Nick Leli
After inspecting some Kubernetes code 
,
 
I see the json `inline` used throughout to create persistent structs.  This 
topic appears to be a proposal 
 from a 
few years ago, yet I don't see any public documentation on the matter, just 
a reference 
 
to Google having the documentation.  Is there any public documentation I am 
not seeing?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] dialing a name with multiple addresses

2016-09-27 Thread 'Anmol Sethi' via golang-nuts
For https://godoc.org/net#Dialer , it says "When dialing a name with
multiple IP addresses, the timeout may be divided between them."

Why? Wouldn't the name still be resolved to a single IP?

E.g. if I have 5 IPs for example.com, one would be selected and used. Why
would the timeout need to be divided among them?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Set ldflags for vendor dependency

2016-09-27 Thread mhhcbon
Hi,

When below code is imported as "github.com/mh-cbon/mysuperpackage" by some 
project,

package mysuperpackage

import (
  "whatever"
)

var SomeVariable = ""

Is this build command correct to set the value of SomeVariable ?

go build --ldflags "-X mysuperpackage.SomeVariable=needed"

thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Win 32bit calling convention

2016-09-27 Thread Luke Mauldin
I am using the steps as detailed at the bottom of this issue 
https://github.com/golang/go/issues/11058 to create a Go shared library on 
Windows exposing C function.  Right now it is all working compiling in 
X64.  If I also want to make an X32 version of my library, I know I will 
have to set some different environment variables and use a different 
version of mingw.  However, my question is, what is the default calling 
convention that the exported Golang functions use and can this be changed?  
(ex: stdcall to cdecl or vice versa).


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] A simple WebM player with support of VP8/VP9 video and Vorbis/Opus audio.

2016-09-27 Thread Maxim Kupriianov
Hi folks,

just a project of a weekend, I've implemented a WebM player that's based on 
libvpx bindings an that actually decodes the video and audio, not a 
shortcut for ffmpeg. While being still poor on audio sync after seeking, it 
works just good enough to show how bindings for large C libs can be useful. 
It also contains sample code on the Opus and Vorbis decoding flow, the 
latter is always really tricky to get right. EBML parsing work is made 
previously by Jorge Acereda Macia, he's a bit upset after I used his code, 
so keep up dude, you rock.

https://github.com/xlab/libvpx-go

Please note that the demo player is based on GLFW+Nuklear to do GUI, there 
may be complications with compiling under Linux or Windows,
feel free to file any bugs you found. I wish I could write that part 
entirely in Go, but not this time.

-Max

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Mocking os.Open and related calls for more code coverage

2016-09-27 Thread Konstantin Khomoutov
On Tue, 27 Sep 2016 18:30:04 +
Edward Muller  wrote:

> One option is to adjust the method to take an io.ReadCloser instead
> of a path so you could pass in anything that supported the
> io.ReadCloser interface (which is easily adapted to via
> ioutil.NoCloser(io.Reader)).

A minor typo correction: that's ioutil.NopCloser (with "Nop" supposedly
standing for "No Operation").

[...]

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Mocking os.Open and related calls for more code coverage

2016-09-27 Thread Edward Muller
One option is to adjust the method to take an io.ReadCloser instead of a
path so you could pass in anything that supported the io.ReadCloser
interface (which is easily adapted to via ioutil.NoCloser(io.Reader)).

Another option is to generate a temporary file with data you want to test
with and pass that in.

Which one to use (or both for that matter) depend on many external factors.

On Tue, Sep 27, 2016 at 9:37 AM  wrote:

> Hello
>
> may be it is a trivial question but I could not find any usable answer to
> the following requirement therefore I thought that
> surely some of you have the answer
>
> Let's assume I have some code like follows:
>
> func (obj *myObjStruct) MyFn(fsPath string) (myRetType, error) {
> cpath := path.Join(fsPath, "subdir", "input.txt")
> fh, err := os.Open(cpath)
> if err != nil {
> log.Error(fmt.Sprintf("Got error %#v", err))
> return nil, err
> }
> defer fh.Close()
> scanner := bufio.NewScanner(fh)
> for scanner.Scan() {
> inLine := scanner.Text()
> ...
>
>
> How should I proceed to mock the os.Open and scanner.xxx calls so that I
> can exercise the remaining parts of the code (... above)
>
> May be I need to rewrite this function a little bit before being able to
> do so but I obviously would not agree to lose the benefits of defering
> fh.Close() call
>
> Thanks for any advice/pointer/...
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [Open sourced] Workflow based REST Api framework - "florest"

2016-09-27 Thread DM
It seems there is a typo in the README

Try:-

go get github.com/jabong/florest-core/*src*/examples

On Tuesday, 27 September 2016 20:17:18 UTC+5:30, parais...@gmail.com wrote:
>
> Reading the doc , trying to reproduce the instructions :
>
>  go get  -u github.com/jabong/florest-core/examples
> package github.com/jabong/florest-core/examples: cannot find package "
> github.com/jabong/florest-core/examples" in any o
>
>
> But that package isn't go gettable at first place anyway. 
>
>
> Le mardi 27 septembre 2016 12:12:48 UTC+2, suba...@gmail.com a écrit :
>>
>> Hi All,
>> Please check this https://github.com/jabong/florest-core.
>>
>> Thanks.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Mocking os.Open and related calls for more code coverage

2016-09-27 Thread obourdon
Hello

may be it is a trivial question but I could not find any usable answer to 
the following requirement therefore I thought that
surely some of you have the answer

Let's assume I have some code like follows:

func (obj *myObjStruct) MyFn(fsPath string) (myRetType, error) {
cpath := path.Join(fsPath, "subdir", "input.txt")
fh, err := os.Open(cpath)
if err != nil {
log.Error(fmt.Sprintf("Got error %#v", err))
return nil, err
}
defer fh.Close()
scanner := bufio.NewScanner(fh)
for scanner.Scan() {
inLine := scanner.Text()
...
 

How should I proceed to mock the os.Open and scanner.xxx calls so that I 
can exercise the remaining parts of the code (... above)

May be I need to rewrite this function a little bit before being able to do 
so but I obviously would not agree to lose the benefits of defering
fh.Close() call

Thanks for any advice/pointer/...

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [Open sourced] Workflow based REST Api framework - "florest"

2016-09-27 Thread paraiso . marc
Reading the doc , trying to reproduce the instructions :

 go get  -u github.com/jabong/florest-core/examples
package github.com/jabong/florest-core/examples: cannot find package 
"github.com/jabong/florest-core/examples" in any o


But that package isn't go gettable at first place anyway. 


Le mardi 27 septembre 2016 12:12:48 UTC+2, suba...@gmail.com a écrit :
>
> Hi All,
> Please check this https://github.com/jabong/florest-core.
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: HTTP2 from net.Listener?

2016-09-27 Thread roger peppe
On 27 September 2016 at 13:30, roger peppe  wrote:
> I'm almost certainly missing something (apologies for the
> stupid question if so), but at the moment
> I don't see a way that, given a net.Listener, I can
> serve HTTP2 using net/http.

As usual, I was indeed missing something trivial. It seems I can pass
in a tls.Listener and set http.Server.TLSConfig to the config used to create
the listener, and it will all work OK as long as I've got "h2" in
the tls.Config.NextProtos slice.

Sorry for the noise.

  cheers,
rog.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] No timeout mechanism with the Request.Body.Read

2016-09-27 Thread Song Liu


http.Server.ReadTimeout is per the whole Read quest, but I need the timeout 
for a single Request.Body.Read.


What need to do ? thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] CQRS reference implementation and Client for GetEventStore released

2016-09-27 Thread JetB
Hi All,

While developing a project over the last several months using CQRS and 
EventSourcing, I have created a client for GetEventStore and a CQRS 
reference implementation which I have released as open source with 
permissive licensing.

I would like to thank Egon Elbre especially for some feedback he gave me a 
couple of months ago on the client API. This was that the API was not very 
idiomatic Go and that an API similar to the database/sql package idiom may 
be better. I have completely reworked the API with this advice in mind and 
it is much better for it in many ways not just in its syntax. Thanks Egon.

The libraries have been dogfooded by myself and one other client and so far 
seem pretty stable and performant. The go.geteventstore has been listed on 
the GetEventStore website as a community client.

The CQRS library was heavily influenced by EventHorizon as this was the 
best CQRS implementation I played around with. I think that go.cqrs has 
some improvements on EventHorizon. One of these being that Events and 
Commands are just plain structs without any magic strings. The other being 
that it uses a CommonDomain repository and comes with an implementation for 
GetEventStore which is a specialsed EventSourcing database.

I hope the community will find these tools useful. Feedback very welcome. 

*GetEventStore client *
https://github.com/jetbasrawi/go.geteventstore

*CQRS Implementation*
https://github.com/jetbasrawi/go.cqrs


Thanks

Jet

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] HTTP2 from net.Listener?

2016-09-27 Thread roger peppe
I'm almost certainly missing something (apologies for the
stupid question if so), but at the moment
I don't see a way that, given a net.Listener, I can
serve HTTP2 using net/http.

Specifically, is it possible to implement this function:

func serveHTTPTLS(lis net.Listener, h http.Handler, cfg *tls.Config) error

and have it serve secure HTTP2 connections using the given listener?

The ListenAndServeTLS entry point calls the internal method
setupHTTP2_ListenAndServeTLS which then uses the internal
type httpServer as a protocol handler, and I don't see
any path to using that code other than through ListenAndServeTLS.

Without being able to pass in a listener, I don't think there's a way of closing
it preemptively and thus there's no way to close
down the HTTP server cleanly.

  cheers,
rog.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] getting method comments from a package

2016-09-27 Thread roger peppe
A slightly different problem, but you might be interested
in this code that I use to find the doc comment for a method
that's been discovered through go/types:

https://play.golang.org/p/POH1FwOCsZ

On 27 September 2016 at 01:46, Dan Kortschak
 wrote:
> Is there a nicer way to do this than what I have here?
>
> func MethodDocComments(path string) (map[string]string, error) {
> fset := token.NewFileSet()
> pkgs, err := parser.ParseDir(fset, path, nil, parser.ParseComments)
> if err != nil {
> return nil, err
> }
>
> docs := make(map[string]string)
> for _, p := range pkgs {
> for _, t := range doc.New(p, path, 
> doc.AllDecls|doc.AllMethods).Types {
> for _, f := range t.Methods {
> d := fmt.Sprint("// ", strings.Replace(f.Doc, 
> "\n", "\n// ", -1))
> docs[f.Name] = strings.TrimSuffix(d, "// ")
> }
> }
> }
> return docs, nil
> }
>
> Ideally, I'd like to just crib the comments directly from the source,
> but I don't see an easy way to do that via the AST, but the string
> munging above just feels wrong.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] [Open sourced] Workflow based REST Api framework - "florest"

2016-09-27 Thread subahjit
Hi All,
Please check this https://github.com/jabong/florest-core.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] idea behind error interface and github.com/pkg/errors

2016-09-27 Thread Ian Davis
On Fri, Sep 23, 2016, at 08:03 AM, Ahmy Yulrizka wrote:
> I understand that, I dont either. But what's the idea behind not
> having it at the first place? Is there more to it other than make it
> more simple?

One possibility is that it reduces the number of allocations (for
storing frame pointers) in the simple case. But since it's an interface
it also makes it easy to provide more sophisticated error
implementations like Dave Cheney's.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: google fuscia and golang and seem to be good mates

2016-09-27 Thread Joe Blue
https://github.com/golang/go/tree/master/src/os

Does not include fuchsia yet... Hmm..

On Tuesday, September 27, 2016 at 9:17:29 AM UTC+2, Joe Blue wrote:
>
>
> https://fuchsia.googlesource.com/third_party/go/+/ad10017bebbc65f67306a3b75d7642e14e773e80/src/os/
>
>
> I found this as i was playing with flutter and golang.
>
> I wonder .., but have no idea what they are up to
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] google fuscia and golang and seem to be good mates

2016-09-27 Thread Joe Blue
https://fuchsia.googlesource.com/third_party/go/+/ad10017bebbc65f67306a3b75d7642e14e773e80/src/os/


I found this as i was playing with flutter and golang.

I wonder .., but have no idea what they are up to


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.