mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
more structure changes, added makefiles
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
*.a
|
||||
*.6
|
||||
bin
|
||||
.settings
|
||||
inquirer/inquirer
|
||||
rater/rater
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
include $(GOROOT)/src/Make.inc
|
||||
|
||||
TARG=inquirer
|
||||
GOFILES=inquirer.go
|
||||
GOFILES=\
|
||||
inquirer.go\
|
||||
registration/registration.go\
|
||||
|
||||
include $(GOROOT)/src/Make.cmd
|
||||
|
||||
@@ -5,12 +5,11 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/rpc"
|
||||
"registration"
|
||||
//"time"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var raterList *registration.RaterList
|
||||
var raterList *RaterList
|
||||
|
||||
func handler(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, "<html><body><ol>")
|
||||
@@ -42,7 +41,7 @@ func testCallRater(){
|
||||
}
|
||||
|
||||
func main() {
|
||||
raterList = registration.NewRaterList()
|
||||
raterList = NewRaterList()
|
||||
go testCallRater()
|
||||
rpc.Register(raterList)
|
||||
rpc.HandleHTTP()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package registration
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -48,4 +48,4 @@ func (rl *RaterList) startBalance() {
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
include $(GOROOT)/src/Make.inc
|
||||
|
||||
TARG=inquirer
|
||||
GOFILES=inquirer.go
|
||||
TARG=rater
|
||||
GOFILES=\
|
||||
rater.go\
|
||||
registration/registration.go\
|
||||
|
||||
include $(GOROOT)/src/Make.cmd
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"math"
|
||||
"net"
|
||||
"net/rpc"
|
||||
"registration"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -26,8 +25,8 @@ func main() {
|
||||
arith := new(Sumer)
|
||||
rpc.Register(arith)
|
||||
rpc.HandleHTTP()
|
||||
go registration.RegisterToServer(server, listen)
|
||||
//go registration.StopSingnalHandler(server, listen)
|
||||
go RegisterToServer(server, listen)
|
||||
go registration.StopSingnalHandler(server, listen)
|
||||
addr, err1 := net.ResolveTCPAddr("tcp", *listen)
|
||||
l, err2 := net.ListenTCP("tcp", addr)
|
||||
if err1 != nil || err2 != nil {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package registration
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
@@ -45,4 +45,4 @@ func RegisterToServer(server, listen *string) {
|
||||
if err := client.Close(); err != nil {
|
||||
log.Panic("Could not close server registration!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user