MCPcopy Create free account
hub / github.com/containerd/nerdctl / Encode

Method Encode

pkg/logging/jsonfile/jsonfile.go:60–68  ·  view source on GitHub ↗

Encode writes a single log entry for the given stream.

(stream, line string)

Source from the content-addressed store, hash-verified

58
59// Encode writes a single log entry for the given stream.
60func (s *SyncEncoder) Encode(stream, line string) error {
61 s.mu.Lock()
62 defer s.mu.Unlock()
63 return s.enc.Encode(&Entry{
64 Stream: stream,
65 Log: line,
66 Time: time.Now().UTC(),
67 })
68}
69
70func Encode(stdout <-chan string, stderr <-chan string, writer io.Writer) error {
71 enc := json.NewEncoder(writer)

Callers 9

createCertFunction · 0.80
WriteLogEntryMethod · 0.80
EncodeFunction · 0.80
SaveMethod · 0.80
SaveMethod · 0.80
writePairFunction · 0.80
buildSearchURLFunction · 0.80
FormatSliceFunction · 0.80
ToJSONFunction · 0.80

Calls 1

LockMethod · 0.65

Tested by

no test coverage detected