MCPcopy Create free account
hub / github.com/dadgar/onecache / parse

Method parse

onecache/memcache_handlers.go:533–557  ·  view source on GitHub ↗
(flags []string)

Source from the content-addressed store, hash-verified

531}
532
533func (h *touchHandler) parse(flags []string) error {
534 l := len(flags)
535 if l != 2 && l != 3 {
536 return fmt.Errorf("received an unexpected number of flags (%d); expect %v", l, expectedTouchInput)
537 }
538
539 h.args.Key = flags[0]
540
541 exp, err := strconv.ParseInt(flags[1], 10, 32)
542 if err != nil {
543 return fmt.Errorf("could not parse expiration field: %v", err)
544 return err
545 }
546 h.args.Exp = convertMemcacheExpToUnix(int32(exp))
547
548 if l == 3 {
549 if flags[2] != noreply {
550 return fmt.Errorf("was expecting %v; got %v", noreply, flags[2])
551 }
552
553 h.noReply = true
554 }
555
556 return nil
557}
558
559func (h *touchHandler) readBytes() int64 {
560 return -1

Callers

nothing calls this directly

Calls 1

convertMemcacheExpToUnixFunction · 0.85

Tested by

no test coverage detected