MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / SaveAs

Method SaveAs

p2p/key.go:86–96  ·  view source on GitHub ↗

SaveAs persists the NodeKey to filePath.

(filePath string)

Source from the content-addressed store, hash-verified

84
85// SaveAs persists the NodeKey to filePath.
86func (nodeKey *NodeKey) SaveAs(filePath string) error {
87 jsonBytes, err := tmjson.Marshal(nodeKey)
88 if err != nil {
89 return err
90 }
91 err = os.WriteFile(filePath, jsonBytes, 0o600)
92 if err != nil {
93 return err
94 }
95 return nil
96}
97
98//------------------------------------------------------------------------------
99

Callers 2

TestNodeKeySaveAsFunction · 0.95
LoadOrGenNodeKeyFunction · 0.95

Calls 2

WriteFileFunction · 0.92
MarshalMethod · 0.45

Tested by 1

TestNodeKeySaveAsFunction · 0.76