MCPcopy Index your code
hub / github.com/coder/coder / EncodeAgentID

Function EncodeAgentID

coderd/agentapi/metadatabatcher/agentid_chunks.go:21–30  ·  view source on GitHub ↗
(agentID uuid.UUID, dst []byte)

Source from the content-addressed store, hash-verified

19)
20
21func EncodeAgentID(agentID uuid.UUID, dst []byte) error {
22 // Encode UUID bytes to base64 without padding (RawStdEncoding).
23 // This produces exactly 22 characters per UUID.
24 reqLen := base64.RawStdEncoding.EncodedLen(len(agentID))
25 if len(dst) < reqLen {
26 return xerrors.Errorf("destination byte slice was too small %d, required %d", len(dst), reqLen)
27 }
28 base64.RawStdEncoding.Encode(dst, agentID[:])
29 return nil
30}
31
32// EncodeAgentIDChunks encodes agent IDs into chunks that fit within the
33// PostgreSQL NOTIFY 8KB payload size limit. Each UUID is base64-encoded

Callers 2

EncodeAgentIDChunksFunction · 0.85

Calls 2

EncodeMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected