rfile

package
v0.0.0-...-36d6306 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckOwnerFile

func CheckOwnerFile(ctx context.Context, fs sfile.FileService, us suser.UserService, fileID idwrap.IDWrap) (bool, error)

CheckOwnerFile verifies if a user owns a file via workspace membership

func CreateService

func CreateService(srv FileServiceRPC, options []connect.HandlerOption) (*api.Service, error)

Types

type FileEvent

type FileEvent struct {
	Type string
	File *apiv1.File
	Name string
}

FileEvent describes a file change for sync streaming.

type FileServiceRPC

type FileServiceRPC struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

func New

func (*FileServiceRPC) FileCollection

FileCollection returns all files the user has access to (TanStack pattern)

func (*FileServiceRPC) FileDelete

FileDelete deletes files and their associated content (HTTP/Flow) using the mutation system. The mutation system handles cascade deletion and auto-publishes events for sync.

func (*FileServiceRPC) FileInsert

FileInsert creates new files with batch operations

func (*FileServiceRPC) FileSync

FileSync handles real-time synchronization for files

func (*FileServiceRPC) FileUpdate

FileUpdate updates existing files

func (*FileServiceRPC) FolderCollection

FolderCollection returns all folders the user has access to (TanStack pattern)

func (*FileServiceRPC) FolderDelete

FolderDelete deletes folders using the mutation system. The mutation system handles cascade deletion and auto-publishes events for sync.

func (*FileServiceRPC) FolderInsert

FolderInsert creates new folders with batch operations

func (*FileServiceRPC) FolderSync

FolderSync handles real-time synchronization for folders

func (*FileServiceRPC) FolderUpdate

FolderUpdate updates existing folders

type FileServiceRPCDeps

type FileServiceRPCDeps struct {
	DB        *sql.DB
	Services  FileServiceRPCServices
	Stream    eventstream.SyncStreamer[FileTopic, FileEvent]
	Publisher mutation.Publisher // Publishes all mutation events (File, HTTP, Flow) to their streams
}

func (*FileServiceRPCDeps) Validate

func (d *FileServiceRPCDeps) Validate() error

type FileServiceRPCServices

type FileServiceRPCServices struct {
	File      *sfile.FileService
	User      suser.UserService
	Workspace sworkspace.WorkspaceService
}

func (*FileServiceRPCServices) Validate

func (s *FileServiceRPCServices) Validate() error

type FileTopic

type FileTopic struct {
	WorkspaceID idwrap.IDWrap
}

FileTopic identifies the workspace whose files are being published.

Jump to

Keyboard shortcuts

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