summaryrefslogtreecommitdiff
path: root/internal/file
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-06 16:55:17 +0200
committerPaul Buetow <paul@buetow.org>2026-03-06 16:55:17 +0200
commitaf72e1023b7a27c137b7ace1cf1a83108e6dc7ba (patch)
tree4ebc60b0d0278a4e1353ce7d1cdb4dd8ce37ba68 /internal/file
parentff85779d14a70825588a80cae33d234153196162 (diff)
docs: add missing godoc comments for exported APIs (task 382)
Diffstat (limited to 'internal/file')
-rw-r--r--internal/file/file.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/file/file.go b/internal/file/file.go
index 83c690a..b95d40b 100644
--- a/internal/file/file.go
+++ b/internal/file/file.go
@@ -11,6 +11,7 @@ import (
"ior/internal/types"
)
+// File is the common interface for file-like syscall payload representations.
type File interface {
String() string
Name() string
@@ -18,6 +19,7 @@ type File interface {
FD() int32
}
+// FdFile represents a file descriptor-backed file reference.
type FdFile struct {
fd int32
name string
@@ -25,6 +27,7 @@ type FdFile struct {
flagsFromProcFS bool
}
+// NewFd constructs an FdFile from explicit descriptor metadata.
func NewFd(fd int32, name string, flags int32) *FdFile {
f := &FdFile{
fd: fd,
@@ -37,6 +40,7 @@ func NewFd(fd int32, name string, flags int32) *FdFile {
return f
}
+// NewFdWithPid resolves descriptor metadata from /proc/<pid>/fd.
func NewFdWithPid(fd int32, pid uint32) *FdFile {
f := &FdFile{
fd: fd,
@@ -122,6 +126,7 @@ type oldnameNewnameFile struct {
Oldname, Newname string
}
+// NewOldnameNewname creates a file representation for rename-like syscalls.
func NewOldnameNewname(oldname, newname []byte) oldnameNewnameFile {
return oldnameNewnameFile{types.StringValue(oldname), types.StringValue(newname)}
}
@@ -156,6 +161,7 @@ type pathnameFile struct {
Pathname string
}
+// NewPathname creates a path-only file representation.
func NewPathname(pathname []byte) pathnameFile {
return pathnameFile{types.StringValue(pathname)}
}