Demo entry 6362642

GO

   

Submitted by anonymous on May 09, 2017 at 18:08
Language: Go. Code size: 724 Bytes.

package venue

import (

    "google_io_demo/deal"
    "google_io_demo/event"

    "github.com/gorilla/mux"
)

func InitRoutes(router *mux.Router, venue Repository, deal deal.Repository, event event.Repository) {

    ctx := NewContext(venue, deal, event)
    ctrl := NewController(ctx)

    venuesRoute := router.PathPrefix("/venues").Subrouter()
    
    // GET - /venues/{venue_id}
    venuesRoute.HandleFunc("/{venue_id}", ctrl.handleGETVenueByID).Methods("GET")

    // PUT - /venues/{venue_id}
    venuesRoute.HandleFunc("/{venue_id}", ctrl.handlePUTVenue).Methods("PUT")

    // DELETE - /venues/{venue_id}
    venuesRoute.HandleFunc("/{venue_id}", ctrl.handleDeleteVenue).Methods("DELETE")
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).