FAQ
I'm currently working on my first real project original it was using php
with the slim micro framework which was a Http Restful API but I want to
keep my app real time.

I've been learning the Golang language for a few months now so I've decided
to convert my project to Go and instead of an API use web sockets to keep
it real time instead of long polling. It isn't a chat app but it follows
same characteristics. I wanna have a bunch of hubs and each hub will have
group of connections which will get updates depending on the hub there in
my problem is i'm having trouble figuring out how I should go about this
what i've thought to do is

Make a type struct named hub which will contain a map of connections but i
don't know how ill keep these hubs in order like which connections go where
etc.
Each group will have a unique key and be connected to a database to hold
info like the key for the group

I would very much appreciate just opinions and tips on how i should go
about implement this into my project.

Also i'm using gorilla websocket and mux in my project which is helping a
ton

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Shawn Milochik at Feb 14, 2016 at 5:37 pm

    On Sun, Feb 14, 2016 at 3:16 AM, Luis Ramirez wrote:

    I'm currently working on my first real project original it was using php
    with the slim micro framework which was a Http Restful API but I want to
    keep my app real time.

    I've been learning the Golang language for a few months now so I've
    decided to convert my project to Go and instead of an API use web sockets
    to keep it real time instead of long polling. It isn't a chat app but it
    follows same characteristics. I wanna have a bunch of hubs and each hub
    will have group of connections which will get updates depending on the hub
    there in my problem is i'm having trouble figuring out how I should go
    about this what i've thought to do is

    Make a type struct named hub which will contain a map of connections but i
    don't know how ill keep these hubs in order like which connections go where
    etc.
    Each group will have a unique key and be connected to a database to hold
    info like the key for the group

    I would very much appreciate just opinions and tips on how i should go
    about implement this into my project.

    Also i'm using gorilla websocket and mux in my project which is helping a
    ton
    I think your question is too vague. Just do the simplest thing that works.
    That may not be defining a custom struct type -- maybe a map of structs is
    fine. Use it. If you run into problems you can consider changing it, or
    show the working (or almost-working) code and describe the specific problem
    so that you can get better answers.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • DennisO at Feb 14, 2016 at 6:43 pm
    @Luis,
    check https://github.com/gin-gonic/gin

    Groupings are really easy there.
    Handling of websocket endpoints (from a router perspective) is no different
    from regular endpoints.

    Dennis

    P.S.
    And yes, as @Shawn mentioned, more specific questions would help to give
    more detailed answers.

    On Sunday, February 14, 2016 at 12:33:27 PM UTC-5, Luis Ramirez wrote:

    I'm currently working on my first real project original it was using php
    with the slim micro framework which was a Http Restful API but I want to
    keep my app real time.

    I've been learning the Golang language for a few months now so I've
    decided to convert my project to Go and instead of an API use web sockets
    to keep it real time instead of long polling. It isn't a chat app but it
    follows same characteristics. I wanna have a bunch of hubs and each hub
    will have group of connections which will get updates depending on the hub
    there in my problem is i'm having trouble figuring out how I should go
    about this what i've thought to do is

    Make a type struct named hub which will contain a map of connections but i
    don't know how ill keep these hubs in order like which connections go where
    etc.
    Each group will have a unique key and be connected to a database to hold
    info like the key for the group

    I would very much appreciate just opinions and tips on how i should go
    about implement this into my project.

    Also i'm using gorilla websocket and mux in my project which is helping a
    ton
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 14, '16 at 5:33p
activeFeb 14, '16 at 6:43p
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase