Key Val store peer get/ret requests and attributes #302

Merged
dan merged 1 commits from dan/cwtch:keyval into master 2020-03-27 19:01:25 +00:00
Owner
  • attributes stored for peers in new attribute struct, serialized to string
  • get/ret val requests for peers
- attributes stored for peers in new attribute struct, serialized to string - get/ret val requests for peers
Author
Owner

cwtch.im/ui#272

is the use of it as well

I'm wondering if anyone has any feelings of the Attribute API? I am thinking maybe moving it from peer to it's own package 'attr' so it is a bit smoother to use, especially with groups?

And any other thoughts would be appreciated

https://git.openprivacy.ca/cwtch.im/ui/pulls/272 is the use of it as well I'm wondering if anyone has any feelings of the Attribute API? I am thinking maybe moving it from peer to it's own package 'attr' so it is a bit smoother to use, especially with groups? And any other thoughts would be appreciated
dan changed title from WIP: Key Val store peer get/ret requests and attributes to Key Val store peer get/ret requests and attributes 2020-03-21 00:07:07 +00:00
erinn was assigned by dan 2020-03-21 00:07:17 +00:00
sarah was assigned by dan 2020-03-21 00:07:18 +00:00
sarah requested changes 2020-03-23 17:52:37 +00:00
@ -0,0 +18,4 @@
Settings = "settings"
)
// Attribute Types
Owner

Are these really needed? I'd prefer to have these stores be string only, and do any type conversions on the UI side.

Are these *really* needed? I'd prefer to have these stores be string only, and do any type conversions on the UI side.
@ -533,0 +554,4 @@
log.Debugf("NewGetValMessageFromPeer for %v%v from %v\n", scope, path, onion)
if scope == Public {
val, exists := cp.GetAttribute(Public + path)
Owner

This should be GetPublicAttribute (path) - don't let programmers mess up by constructing the paths

This should be GetPublicAttribute (path) - don't let programmers mess up by constructing the paths
@ -533,0 +577,4 @@
log.Debugf("NewRetValMessageFromPeer %v %v%v %v %v\n", onion, scope, path, exists, val)
if exists {
if scope == Public {
cp.SetContactAttribute(onion, Peer+path, StringToAttribute(val))
Owner

Same as above, the API should enforce paths

Same as above, the API should enforce paths
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/738
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/739
sarah approved these changes 2020-03-27 18:30:08 +00:00
@ -31,2 +46,2 @@
func (pa PeerApp) NewInstance() tapir.Application {
newApp := new(PeerApp)
func (pa *PeerApp) NewInstance() tapir.Application {
newApp := &PeerApp{} //new(PeerApp)
Owner

why?

why?
Author
Owner

lol left over debug junk, will fix

lol left over debug junk, will fix
@ -74,8 +90,15 @@ func (pa PeerApp) listen() {
if err == nil {
if peerMessage.Context == event.ContextAck {
Owner

This should be a switch

This should be a switch
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/740
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/741
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/742
dan closed this pull request 2020-03-27 19:01:24 +00:00
Sign in to join this conversation.
No description provided.