Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

need a way to set data on a node #4

Closed
beardeddog opened this issue Dec 7, 2012 · 4 comments
Closed

need a way to set data on a node #4

beardeddog opened this issue Dec 7, 2012 · 4 comments

Comments

@beardeddog
Copy link

so add the following function in conn.go based off of the set and get functions

func (c *Conn) Set(path string, data []byte) (stat *Stat, err error) {
    xid := c.nextXid()
    ch := make(chan error)
    rs := &setDataResponse{}
    req := &request{
        xid: xid,
        pkt: &setDataRequest{
            requestHeader: requestHeader{
                Xid:    xid,
                Opcode: opSetData,
            },
            Path:    path,
            Data:    data,
            Version: -1,
        },
        recvStruct: rs,
        recvChan:   ch,
    }
    c.sendChan <- req
    err = <-ch
    stat = &rs.Stat
    return
}
@dboek
Copy link

dboek commented Dec 12, 2012

@beardeddog could you fork the project and add your code and send a pull request to @samuel ? Would be nice to have the 'set data' code and the 'create node' code in the project.

@beardeddog
Copy link
Author

@dboek, ok, did the fork and pull request ... hopefully I did it right :)

@samuel
Copy link
Owner

samuel commented Dec 12, 2012

The issue with create was a bad ACL struct and bad serialization. I've fixed both in the latest commit. Also added better error reporting and Set, Create, and Delete.

@samuel samuel closed this as completed Dec 12, 2012
@dboek
Copy link

dboek commented Dec 12, 2012

@beardeddog and @samuel great and thanks to you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants