func ParseDialKey(s string) (dk *DialKey, err os.Error) { i, err := eye64.EyeToU64(s) if err != nil { return nil, err } k := DialKey(i) return &k, nil }
func parseOrigin(req *http.Request) (oid sys.Id, err os.Error) { if req.Header == nil { err = os.EINVAL return } orig, ok := req.Header["Vault-Origin"] if !ok { err = os.EINVAL return } u64, err := eye64.EyeToU64(strings.TrimSpace(orig)) if err != nil { err = os.EINVAL return } return sys.Id(u64), nil }
func ParseId(s string) (Id, os.Error) { u, err := eye64.EyeToU64(s) id := Id(u) return id, err }