(agentID uuid.UUID, dst []byte)
| 19 | ) |
| 20 | |
| 21 | func 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 |
no test coverage detected