MCPcopy
hub / github.com/ha/doozerd / EncodeSet

Function EncodeSet

src/pkg/store/store.go:131–136  ·  view source on GitHub ↗

Returns a mutation that can be applied to a `Store`. The mutation will set the contents of the file at `path` to `body` iff `rev` is greater than of equal to the file's revision at the time of application, with one exception: if `rev` is Clobber, the file will be set unconditionally.

(path, body string, rev int64)

Source from the content-addressed store, hash-verified

129// of equal to the file's revision at the time of application, with
130// one exception: if `rev` is Clobber, the file will be set unconditionally.
131func EncodeSet(path, body string, rev int64) (mutation string, err os.Error) {
132 if err = checkPath(path); err != nil {
133 return
134 }
135 return strconv.Itoa64(rev) + ":" + path + "=" + body, nil
136}
137
138// Returns a mutation that can be applied to a `Store`. The mutation will cause
139// the file at `path` to be deleted iff `rev` is greater than

Callers 3

MustEncodeSetFunction · 0.85
TestEncodeSetFunction · 0.85
BenchmarkEncodeSetFunction · 0.85

Calls 1

checkPathFunction · 0.85

Tested by 2

TestEncodeSetFunction · 0.68
BenchmarkEncodeSetFunction · 0.68