mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Moved stuff to main instead of init
This commit is contained in:
@@ -42,6 +42,25 @@ var config struct {
|
||||
var icache = cache.New("routing-table")
|
||||
|
||||
func init() {
|
||||
|
||||
}
|
||||
|
||||
type Route struct {
|
||||
// TODO: Change destinations to a simple cache so it can expire entries after 55 minutes (the one we use in common?)
|
||||
Host string `json:"host"`
|
||||
Destinations []string `json:"destinations"`
|
||||
ProjectId string `json:"project_id"`
|
||||
Token string `json:"token"` // store this so we can queue up new workers on demand
|
||||
CodeName string `json:"code_name"`
|
||||
}
|
||||
|
||||
// for adding new hosts
|
||||
type Route2 struct {
|
||||
Host string `json:"host"`
|
||||
Dest string `json:"dest"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
log.Println("Running on", runtime.NumCPU(), "CPUs")
|
||||
|
||||
@@ -62,25 +81,6 @@ func init() {
|
||||
common.SetLogLocation(config.Logging.To, config.Logging.Prefix)
|
||||
|
||||
icache.Settings.UseConfigMap(map[string]interface{}{"token": config.Iron.Token, "project_id": config.Iron.ProjectId})
|
||||
}
|
||||
|
||||
type Route struct {
|
||||
// TODO: Change destinations to a simple cache so it can expire entries after 55 minutes (the one we use in common?)
|
||||
Host string `json:"host"`
|
||||
Destinations []string `json:"destinations"`
|
||||
ProjectId string `json:"project_id"`
|
||||
Token string `json:"token"` // store this so we can queue up new workers on demand
|
||||
CodeName string `json:"code_name"`
|
||||
}
|
||||
|
||||
// for adding new hosts
|
||||
type Route2 struct {
|
||||
Host string `json:"host"`
|
||||
Dest string `json:"dest"`
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
|
||||
r := mux.NewRouter()
|
||||
s := r.Headers("Iron-Router", "").Subrouter()
|
||||
|
||||
Reference in New Issue
Block a user