Documentation
¶
Index ¶
- func CheckOwnerFile(ctx context.Context, fs sfile.FileService, us suser.UserService, ...) (bool, error)
- func CreateService(srv FileServiceRPC, options []connect.HandlerOption) (*api.Service, error)
- type FileEvent
- type FileServiceRPC
- func (f *FileServiceRPC) FileCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[apiv1.FileCollectionResponse], error)
- func (f *FileServiceRPC) FileDelete(ctx context.Context, req *connect.Request[apiv1.FileDeleteRequest]) (*connect.Response[emptypb.Empty], error)
- func (f *FileServiceRPC) FileInsert(ctx context.Context, req *connect.Request[apiv1.FileInsertRequest]) (*connect.Response[emptypb.Empty], error)
- func (f *FileServiceRPC) FileSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (f *FileServiceRPC) FileUpdate(ctx context.Context, req *connect.Request[apiv1.FileUpdateRequest]) (*connect.Response[emptypb.Empty], error)
- func (f *FileServiceRPC) FolderCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[apiv1.FolderCollectionResponse], error)
- func (f *FileServiceRPC) FolderDelete(ctx context.Context, req *connect.Request[apiv1.FolderDeleteRequest]) (*connect.Response[emptypb.Empty], error)
- func (f *FileServiceRPC) FolderInsert(ctx context.Context, req *connect.Request[apiv1.FolderInsertRequest]) (*connect.Response[emptypb.Empty], error)
- func (f *FileServiceRPC) FolderSync(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (f *FileServiceRPC) FolderUpdate(ctx context.Context, req *connect.Request[apiv1.FolderUpdateRequest]) (*connect.Response[emptypb.Empty], error)
- type FileServiceRPCDeps
- type FileServiceRPCServices
- type FileTopic
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 FileServiceRPC ¶
func New ¶
func New(deps FileServiceRPCDeps) FileServiceRPC
func (*FileServiceRPC) FileCollection ¶
func (f *FileServiceRPC) FileCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[apiv1.FileCollectionResponse], error)
FileCollection returns all files the user has access to (TanStack pattern)
func (*FileServiceRPC) FileDelete ¶
func (f *FileServiceRPC) FileDelete(ctx context.Context, req *connect.Request[apiv1.FileDeleteRequest]) (*connect.Response[emptypb.Empty], error)
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 ¶
func (f *FileServiceRPC) FileInsert(ctx context.Context, req *connect.Request[apiv1.FileInsertRequest]) (*connect.Response[emptypb.Empty], error)
FileInsert creates new files with batch operations
func (*FileServiceRPC) FileSync ¶
func (f *FileServiceRPC) FileSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[apiv1.FileSyncResponse]) error
FileSync handles real-time synchronization for files
func (*FileServiceRPC) FileUpdate ¶
func (f *FileServiceRPC) FileUpdate(ctx context.Context, req *connect.Request[apiv1.FileUpdateRequest]) (*connect.Response[emptypb.Empty], error)
FileUpdate updates existing files
func (*FileServiceRPC) FolderCollection ¶
func (f *FileServiceRPC) FolderCollection(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[apiv1.FolderCollectionResponse], error)
FolderCollection returns all folders the user has access to (TanStack pattern)
func (*FileServiceRPC) FolderDelete ¶
func (f *FileServiceRPC) FolderDelete(ctx context.Context, req *connect.Request[apiv1.FolderDeleteRequest]) (*connect.Response[emptypb.Empty], error)
FolderDelete deletes folders using the mutation system. The mutation system handles cascade deletion and auto-publishes events for sync.
func (*FileServiceRPC) FolderInsert ¶
func (f *FileServiceRPC) FolderInsert(ctx context.Context, req *connect.Request[apiv1.FolderInsertRequest]) (*connect.Response[emptypb.Empty], error)
FolderInsert creates new folders with batch operations
func (*FileServiceRPC) FolderSync ¶
func (f *FileServiceRPC) FolderSync(ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[apiv1.FolderSyncResponse]) error
FolderSync handles real-time synchronization for folders
func (*FileServiceRPC) FolderUpdate ¶
func (f *FileServiceRPC) FolderUpdate(ctx context.Context, req *connect.Request[apiv1.FolderUpdateRequest]) (*connect.Response[emptypb.Empty], error)
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