core

package
v0.0.0-...-35e1393 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	fs.Inode
	Client *github.Client
	Logger *slog.Logger
	Owner  string
	Repo   string
	Path   string // Path within the repository (e.g., "docker" or "src/main")
}

Dir represents a directory within a GitHub repository

func (*Dir) Getattr

func (d *Dir) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*Dir) Lookup

func (d *Dir) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*Dir) Readdir

func (d *Dir) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)

type FS

type FS struct {
	fs.Inode
	Client *github.Client
	Logger *slog.Logger
}

FS represents the FUSE filesystem root

func (*FS) Getattr

func (f *FS) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

Getattr returns attributes for the root directory

func (*FS) Lookup

func (f *FS) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

Lookup looks up a child node in the root directory

func (*FS) Readdir

func (f *FS) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)

Readdir reads the root directory

type File

type File struct {
	fs.Inode
	Content *github.RepositoryContent
	Client  *github.Client
	Logger  *slog.Logger
	Owner   string
	Repo    string
}

File represents a file within a GitHub repository

func (*File) Getattr

func (f *File) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*File) OnForget

func (f *File) OnForget()

OnForget is called when the kernel forgets this inode

func (*File) Open

func (f *File) Open(ctx context.Context, flags uint32) (fs.FileHandle, uint32, syscall.Errno)

type FileHandle

type FileHandle struct {
	// contains filtered or unexported fields
}

FileHandle represents an open file handle

func (*FileHandle) Read

func (fh *FileHandle) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)

type GitHubHTTPTransport

type GitHubHTTPTransport struct {
	Token  string // Empty if unauthenticated
	Base   http.RoundTripper
	Logger *slog.Logger
}

GitHubHTTPTransport handles authentication and logging.

func (*GitHubHTTPTransport) RoundTrip

func (t *GitHubHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper with authentication, header normalization, and logging.

type Repository

type Repository struct {
	fs.Inode
	*github.Repository
	Client *github.Client
	Logger *slog.Logger
}

Repository represents a GitHub repository directory

func (*Repository) Getattr

func (r *Repository) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*Repository) Lookup

func (r *Repository) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*Repository) Readdir

func (r *Repository) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)

type RevalidationSuppressor

type RevalidationSuppressor struct {
	Base             http.RoundTripper
	SuppressDuration time.Duration
	Logger           *slog.Logger
	MaxEntries       int // Maximum number of URLs to track (default 1000)
	// contains filtered or unexported fields
}

RevalidationSuppressor wraps an http.RoundTripper and suppresses revalidation requests for a configured duration after receiving a 304 Not Modified response.

TODO: Replace homegrown LRU with a more efficient implementation (e.g., hashicorp/golang-lru or github.com/karlseguin/ccache) to reduce allocations and lock contention.

func (*RevalidationSuppressor) ClearSuppressionCache

func (r *RevalidationSuppressor) ClearSuppressionCache()

ClearSuppressionCache clears the revalidation suppression cache, allowing immediate revalidation. This is useful when users want to force a refresh of cached data.

func (*RevalidationSuppressor) RoundTrip

func (r *RevalidationSuppressor) RoundTrip(req *http.Request) (*http.Response, error)

type User

type User struct {
	fs.Inode
	*github.User
	Client *github.Client
	Logger *slog.Logger
}

User represents a GitHub user or organization directory

func (*User) Getattr

func (u *User) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*User) Lookup

func (u *User) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*User) Readdir

func (u *User) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL