Skip to content

Commit

Permalink
go get & fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lugu committed Dec 11, 2019
1 parent 589f361 commit 633bb8b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 37 deletions.
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ go 1.13

require (
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lugu/qiloop v0.0.0-20191121014346-1dcf73844760
github.com/mattn/go-runewidth v0.0.6 // indirect
github.com/lucas-clemente/quic-go v0.14.1 // indirect
github.com/lugu/qiloop v0.0.0-20191211222157-76bf14fc856f
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/mum4k/termdash v0.10.0
github.com/nsf/termbox-go v0.0.0-20190817171036-93860e161317
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 // indirect
)
36 changes: 14 additions & 22 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
github.com/dave/jennifer v1.3.0 h1:p3tl41zjjCZTNBytMwrUuiAnherNUZktlhPTKoF/sEk=
github.com/dave/jennifer v1.3.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
github.com/dave/jennifer v1.4.0 h1:tNJFJmLDVTLu+v05mVZ88RINa3vQqnyyWkTKWYz0CwE=
github.com/dave/jennifer v1.4.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ=
github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
Expand All @@ -32,21 +32,19 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lucas-clemente/quic-go v0.13.1 h1:CxtJTXQIh2aboCPk0M6vf530XOov6DZjVBiSE3nSj8s=
github.com/lucas-clemente/quic-go v0.13.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU=
github.com/lugu/qiloop v0.0.0-20191117222453-a71b0dbbbeab h1:Njj0evFXypzMzNp+ajU/qEI24DO4t37CoOFYNLXP9nU=
github.com/lugu/qiloop v0.0.0-20191117222453-a71b0dbbbeab/go.mod h1:Wyu9qTDAtgaCPjq0++b54Uk3hzDMuIK7/QNSjseDIxU=
github.com/lugu/qiloop v0.0.0-20191119230647-1da2eb70f37a h1:NJ8GB0KHUjmMEqmsagUecWLgrs4MCMF9WbGqY94VBbg=
github.com/lugu/qiloop v0.0.0-20191119230647-1da2eb70f37a/go.mod h1:Wyu9qTDAtgaCPjq0++b54Uk3hzDMuIK7/QNSjseDIxU=
github.com/lugu/qiloop v0.0.0-20191121014346-1dcf73844760 h1:PMoZtFpNsFloxEfwJiG3IX5Mr8rcidx8PXZzvcp/cig=
github.com/lugu/qiloop v0.0.0-20191121014346-1dcf73844760/go.mod h1:sHZkdBZKHijIW/6LL/7ELlKavEBoFGoq6r4Eb2FDuGA=
github.com/lucas-clemente/quic-go v0.14.1 h1:c1aKoBZKOPA+49q96B1wGkibyPP0AxYh45WuAoq+87E=
github.com/lucas-clemente/quic-go v0.14.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU=
github.com/lugu/qiloop v0.0.0-20191211222157-76bf14fc856f h1:c1yev/AF3n2taB/2Go19enTG/7kvFXKBsboEL1OjJK0=
github.com/lugu/qiloop v0.0.0-20191211222157-76bf14fc856f/go.mod h1:NkweYVxhfzf4oUBIAGXzwlY7aj8FsmIz/QKJGi8/n7U=
github.com/marten-seemann/chacha20 v0.2.0 h1:f40vqzzx+3GdOmzQoItkLX5WLvHgPgyYqFFIO5Gh4hQ=
github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE=
github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI=
github.com/marten-seemann/qtls v0.4.1 h1:YlT8QP3WCCvvok7MGEZkMldXbyqgr8oFg5/n8Gtbkks=
github.com/marten-seemann/qtls v0.4.1/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc=
github.com/mattes/go-asciibot v0.0.0-20190603170252-3fa6d766c482 h1:Is74U2kXPdMV6wu/Z1QYiFB8SrNvhFx9EK7ZS/4i5kM=
github.com/mattes/go-asciibot v0.0.0-20190603170252-3fa6d766c482/go.mod h1:akTvhl4803od3DOIWgnTKgOJx3Pevvt7BU9pRrKdRVA=
github.com/mattn/go-runewidth v0.0.6 h1:V2iyH+aX9C5fsYCpK60U8BYIvmhqxuOL3JZcqc1NB7k=
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mum4k/termdash v0.10.0 h1:uqM6ePiMf+smecb1tJJeON36o1hREeCfOmLFG0iz4a0=
github.com/mum4k/termdash v0.10.0/go.mod h1:l3tO+lJi9LZqXRq7cu7h5/8rDIK3AzelSuq2v/KncxI=
github.com/nsf/termbox-go v0.0.0-20190817171036-93860e161317 h1:hhGN4SFXgXo61Q4Sjj/X9sBjyeSa2kdpaOzCO+8EVQw=
Expand All @@ -62,12 +60,9 @@ github.com/prataprc/goparsec v0.0.0-20180806094145-2600a2a4a410 h1:BZjOxwDguSqFR
github.com/prataprc/goparsec v0.0.0-20180806094145-2600a2a4a410/go.mod h1:YbpxZqbf10o5u96/iDpcfDQmbIOTX/iNCH/yBByTfaM=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191108234033-bd318be0434a h1:R/qVym5WAxsZWQqZCwDY/8sdVKV1m1WgU4/S5IRQAzc=
golang.org/x/crypto v0.0.0-20191108234033-bd318be0434a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f h1:kz4KIr+xcPUsI3VMoqWfPMvtnJ6MGfiVwsWSVzphMO4=
golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba h1:9bFeDpN3gTqNanMVqNcoR/pJQuP5uroC3t1D7eXozTE=
golang.org/x/crypto v0.0.0-20191119213627-4f8c1d86b1ba/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand All @@ -80,12 +75,9 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4 h1:Hynbrlo6LbYI3H1IqXpkVDOcX/3HiPdhVEuyj5a59RM=
golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191117211529-81af7394a238 h1:Bm3cDUUSrXTkUZ5SygdSTSdbkL29gk0MB0IOqdvfPuA=
golang.org/x/sys v0.0.0-20191117211529-81af7394a238/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ=
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand Down
7 changes: 3 additions & 4 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type logger struct {
func newLogger(sess bus.Session, w *widgets, service, method string) (*logger, error) {
w.logScroll.Reset()

directory, err := services.Services(sess).ServiceDirectory(nil)
directory, err := services.ServiceDirectory(sess)
if err != nil {
return nil, err
}
Expand All @@ -46,8 +46,7 @@ func newLogger(sess bus.Session, w *widgets, service, method string) (*logger, e
}
location := fmt.Sprintf("%s:%d", info.MachineId, info.ProcessId)

srv := qilog.Services(sess)
logManager, err := srv.LogManager(nil)
logManager, err := qilog.LogManager(sess)
if err != nil {
return nil, fmt.Errorf("access LogManager service: %s", err)
}
Expand All @@ -71,7 +70,7 @@ func newLogger(sess bus.Session, w *widgets, service, method string) (*logger, e
}

go func() {
defer logListener.Terminate(logListener.ObjectID())
defer logListener.Terminate(logListener.Proxy().ObjectID())
for {
msgs, ok := <-logs
for _, m := range msgs {
Expand Down
14 changes: 6 additions & 8 deletions stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (h *highlight) updateService(serviceName string, info sd.ServiceInfo) error
return err
}

meta, err := obj.MetaObject(obj.ObjectID())
meta, err := obj.MetaObject(obj.Proxy().ObjectID())
if err != nil {
return err
}
Expand All @@ -160,17 +160,15 @@ func (h *highlight) updateService(serviceName string, info sd.ServiceInfo) error

// returns a function which update the top statistics
func (h *highlight) initServices(ctx context.Context, sess bus.Session, cancel context.CancelFunc) error {
proxies := sd.Services(sess)

onDisconnect := func(err error) {
mainErr = fmt.Errorf("Service directory disconnection: %s", err)
cancel()
}

directory, err := proxies.ServiceDirectory(onDisconnect)
directory, err := sd.ServiceDirectory(sess)
if err != nil {
return err
}
directory.Proxy().OnDisconnect(func(err error) {
mainErr = fmt.Errorf("Service directory disconnection: %s", err)
cancel()
})

serviceList, err := directory.Services()
if err != nil {
Expand Down
12 changes: 11 additions & 1 deletion trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/lugu/qiloop/bus"
"github.com/lugu/qiloop/bus/net"
"github.com/lugu/qiloop/type/object"
"github.com/lugu/qiloop/type/value"
"github.com/mum4k/termdash/cell"
"github.com/mum4k/termdash/widgets/linechart"
Expand Down Expand Up @@ -60,6 +61,15 @@ type collector struct {
pending map[uint32]bus.EventTrace
}

func methodID(meta object.MetaObject, method string) (uint32, error) {
for id, m := range meta.Methods {
if m.Name == method {
return id, nil
}
}
return 0, fmt.Errorf("method not found: %s", method)
}

func newCollector(sess bus.Session, w *widgets, service, method string) (*collector, error) {
objectID := uint32(1)
proxy, err := sess.Proxy(service, objectID)
Expand All @@ -73,7 +83,7 @@ func newCollector(sess bus.Session, w *widgets, service, method string) (*collec
return nil, fmt.Errorf("%s: MetaObject: %s.", service, err)
}

slot, err := meta.MethodID(method)
slot, err := methodID(meta, method)
if err != nil {
return nil, fmt.Errorf("method not found: %s.", method)
}
Expand Down

0 comments on commit 633bb8b

Please sign in to comment.