{"modulePath":"github.com/github/github-mcp-server/v2","version":"v2.1.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package buffer\n\n## Functions\n\n```go\nfunc ProcessResponseAsRingBufferToEnd(httpResp *http.Response, maxJobLogLines int) (string, int, *http.Response, error)\n```\nProcessResponseAsRingBufferToEnd reads the body of an HTTP response line by line, storing only the last maxJobLogLines lines using a ring buffer (sliding window). This efficiently retains the most recent lines, overwriting older ones as needed.\n\nParameters:\n\n\thttpResp:        The HTTP response whose body will be read.\n\tmaxJobLogLines:  The maximum number of log lines to retain.\n\nReturns:\n\n\tstring:          The concatenated log lines (up to maxJobLogLines), separated by newlines.\n\tint:             The total number of lines read from the response.\n\t*http.Response:  The original HTTP response.\n\terror:           Any error encountered during reading.\n\nThe function uses a ring buffer to efficiently store only the last maxJobLogLines lines. If the response contains more lines than maxJobLogLines, only the most recent lines are kept. Lines exceeding maxLineSize are truncated with a marker.\n\n","path":"github.com/github/github-mcp-server/v2/pkg/buffer","name":"buffer","synopsis":"","isRedistributable":true}
