This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package polls | |
import ( | |
"flamingo.me/dingo" | |
"flamingo.me/flamingo/v3/framework/web" | |
) | |
type Module struct{} | |
func (*Module) Configure(injector *dingo.Injector) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"mysite/polls" | |
"flamingo.me/dingo" | |
"flamingo.me/flamingo/v3" | |
"flamingo.me/flamingo/v3/core/requestlogger" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package db | |
import ( | |
"flamingo.me/dingo" | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/sqlite" | |
) | |
type Module struct{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package polls | |
import ( | |
"mysite/db" | |
"flamingo.me/dingo" | |
"flamingo.me/flamingo/v3/framework/web" | |
) | |
type Module struct{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package polls | |
import ( | |
"time" | |
"github.com/jinzhu/gorm" | |
) | |
type Question struct { | |
gorm.Model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package db | |
import ( | |
"log" | |
"flamingo.me/dingo" | |
"github.com/jinzhu/gorm" | |
"github.com/spf13/cobra" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package polls | |
// ... | |
func (*Module) Configure(injector *dingo.Injector) { | |
// ... | |
injector.BindMulti(new(db.Model)).To(Question{}) | |
injector.BindMulti(new(db.Model)).To(Choice{}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package polls | |
import ( | |
"context" | |
"fmt" | |
"net/http" | |
"strconv" | |
"strings" | |
"flamingo.me/flamingo/v3/framework/web" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package polls | |
import "flamingo.me/flamingo/v3/framework/web" | |
type urls struct { | |
controller *controller | |
} | |
func (u *urls) Inject(controller *controller) { | |
u.controller = controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"mysite/polls" | |
"flamingo.me/dingo" | |
"flamingo.me/flamingo/v3" | |
"flamingo.me/flamingo/v3/core/gotemplate" | |
"flamingo.me/flamingo/v3/core/requestlogger" | |
) |