Commit 4d96a4b9 authored by Benjamin Rokseth's avatar Benjamin Rokseth
Browse files

make koha api configurable

parent e60d8ae4
Pipeline #2115 failed with stages
in 21 seconds
......@@ -135,6 +135,7 @@ type server struct {
sipPass string
listAddr string
kohaApi string
mu sync.RWMutex
db map[string]record
......@@ -276,7 +277,7 @@ func (s *server) itemFound(branchcode, barcode string) error {
func (s *server) itemIPP(itemnumber string) error {
log.Println("Attempting mark item as maybe IPP:", itemnumber)
req, err := http.NewRequest("PUT", "http://xkoha:8081/api/items/"+itemnumber+"/maybeIPP", nil)
req, err := http.NewRequest("PUT", s.kohaApi+"/items/"+itemnumber+"/maybeIPP", nil)
if err != nil {
return err
}
......@@ -750,11 +751,13 @@ func main() {
freq := flag.Duration("freq", 1*time.Minute, "Polling frequency")
httpAddr := flag.String("http", ":7777", "HTTP serve address")
listAddr := flag.String("list", "http://sputnik:8081/holdsqueue/plukkliste.json", "plukkliste (JSON) HTTP address")
kohaApi := flag.String("koha", "http://xkoha:8081/api", "Base of Koha API")
flag.Parse()
srv := newServer()
srv.listAddr = *listAddr
srv.kohaApi = *kohaApi
srv.sipAddr = os.Getenv("SIP_ADDR")
srv.sipUser = os.Getenv("SIP_USER")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment