agents/anchor-edge-agent/internal/buffer/file_buffer.go
Metadata
- Purpose: Edge agent runtime code for endpoint telemetry collection and transport.
- Domain:
agents - Language:
go - Bytes: 1424
- Lines: 77
- Content hash (short):
42a83acc - Source (start): agents/anchor-edge-agent/internal/buffer/file_buffer.go:1
- Source (end): agents/anchor-edge-agent/internal/buffer/file_buffer.go:77
Indexed Symbols
NewFileBuffer(line 17, go function) - Implements new file buffer for module behavior.Append(line 29, go function) - Implements append for module behavior.ReadAll(line 45, go function) - Implements read all for module behavior.Clear(line 74, go function) - Implements clear for module behavior.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
package buffer
import (
"bufio"
"encoding/json"
"errors"
"os"
"path/filepath"
"github.com/anchor-msp/anchor-edge-agent/internal/types"
)
type FileBuffer struct {
path string
}
func NewFileBuffer(path string) (*FileBuffer, error) {
if path == "" {
return nil, errors.New("buffer path is required")
}
if err := os.MkdirAll(filepath.Dir(path), 0o750); err != nil {
return nil, err
}