services

package
v0.1.49 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSourceURI added in v0.1.47

func ParseSourceURI(uri string) (integration, resultID string, err error)

ParseSourceURI splits "integration://resultID" into its parts.

Types

type AccessService added in v0.1.47

type AccessService struct {
	pb.UnimplementedAccessLogServiceServer
	// contains filtered or unexported fields
}

AccessService ingests batched logical-read events emitted by mounts. Events are normalized with auth-derived workspace/session fields and persisted via the shared recorder.

func NewAccessService added in v0.1.47

func NewAccessService(recorder instrumentation.AccessRecorder, rdb *common.RedisClient) *AccessService

func (*AccessService) IngestAccessEvents added in v0.1.47

type ContextService

type ContextService struct {
	pb.UnimplementedContextServiceServer
	// contains filtered or unexported fields
}

ContextService provides S3-backed file storage for workspace context.

func NewContextService

func NewContextService(cfg types.S3Config) (*ContextService, error)

NewContextService creates a new context service with retry and timeout configuration

func (*ContextService) Create

Create creates a new empty file

func (*ContextService) Delete

Delete removes a file or directory

func (*ContextService) ListTree

ListTree returns flat listing of subtree (for future prefetching)

func (*ContextService) Mkdir

Mkdir creates a directory

func (*ContextService) Read

Read reads file content with size limits to prevent OOM

func (*ContextService) ReadDir

ReadDir lists directory contents with full metadata

Readlink reads a symbolic link target

func (*ContextService) Rename

Rename moves/renames a file or directory (copy then delete)

func (*ContextService) Stat

Stat returns file/directory attributes

Symlink creates a symbolic link

func (*ContextService) Truncate

Truncate changes file size

func (*ContextService) Write

Write writes file content with size limits

type FilesystemService

type FilesystemService struct {
	pb.UnimplementedFilesystemServiceServer
	// contains filtered or unexported fields
}

FilesystemService provides gRPC filesystem metadata operations. This service is used by the FUSE client for caching metadata.

func NewFilesystemService

func NewFilesystemService(store repository.FilesystemStore) *FilesystemService

NewFilesystemService creates a new FilesystemService.

func (*FilesystemService) Chmod

Chmod changes file permissions.

func (*FilesystemService) Create

Create creates a file.

func (*FilesystemService) Mkdir

Mkdir creates a directory.

func (*FilesystemService) ReadDir

ReadDir returns directory entries.

func (*FilesystemService) Remove

Remove removes a file or directory.

func (*FilesystemService) Rename

Rename renames a file or directory.

func (*FilesystemService) Stat

Stat returns metadata for a path. Uses pipelined Redis lookup (single round-trip for dir + file + symlink).

type GatewayService

type GatewayService struct {
	pb.UnimplementedGatewayServiceServer
	// contains filtered or unexported fields
}

func NewGatewayService

func NewGatewayService(backend repository.BackendRepository, s2Client *common.S2Client, fsStore repository.FilesystemStore, eventBus *common.EventBus, sourceRegistry *sources.Registry) *GatewayService

func (*GatewayService) AddConnection

func (*GatewayService) AddMember

func (*GatewayService) CreateHook added in v0.1.28

func (s *GatewayService) CreateHook(ctx context.Context, req *pb.CreateHookRequest) (*pb.HookResponse, error)

func (*GatewayService) CreateTask added in v0.1.31

func (s *GatewayService) CreateTask(ctx context.Context, req *pb.CreateTaskRequest) (*pb.TaskResponse, error)

func (*GatewayService) CreateToken

func (*GatewayService) CreateWorkerToken

func (*GatewayService) CreateWorkspace

func (*GatewayService) DeleteHook added in v0.1.28

func (*GatewayService) DeleteTask added in v0.1.31

func (*GatewayService) DeleteWorkspace

func (s *GatewayService) DeleteWorkspace(ctx context.Context, req *pb.DeleteWorkspaceRequest) (*pb.DeleteResponse, error)

func (*GatewayService) GetHook added in v0.1.28

func (s *GatewayService) GetHook(ctx context.Context, req *pb.GetHookRequest) (*pb.HookResponse, error)

func (*GatewayService) GetTask

func (s *GatewayService) GetTask(ctx context.Context, req *pb.GetTaskRequest) (*pb.TaskResponse, error)

func (*GatewayService) GetTaskLogs

func (*GatewayService) GetWorkspace

func (*GatewayService) ListConnections

func (*GatewayService) ListHookRuns added in v0.1.28

func (*GatewayService) ListHooks added in v0.1.28

func (*GatewayService) ListMembers

func (*GatewayService) ListTasks

func (*GatewayService) ListTokens

func (*GatewayService) ListWorkerTokens

func (*GatewayService) ListWorkspaces

func (*GatewayService) RemoveConnection

func (s *GatewayService) RemoveConnection(ctx context.Context, req *pb.RemoveConnectionRequest) (*pb.DeleteResponse, error)

func (*GatewayService) RemoveMember

func (s *GatewayService) RemoveMember(ctx context.Context, req *pb.RemoveMemberRequest) (*pb.DeleteResponse, error)

func (*GatewayService) RevokeToken

func (s *GatewayService) RevokeToken(ctx context.Context, req *pb.RevokeTokenRequest) (*pb.DeleteResponse, error)

func (*GatewayService) SetSourceService added in v0.1.34

func (s *GatewayService) SetSourceService(svc *SourceService)

SetSourceService injects the SourceService so that connection mutations (add/remove) can invalidate the connected-integrations cache immediately.

func (*GatewayService) SetTaskQueue added in v0.1.31

func (s *GatewayService) SetTaskQueue(queue repository.TaskQueue, defaultImage string)

SetTaskQueue wires the task queue and default image for CreateTask. Called after the queue is initialized during gateway startup.

func (*GatewayService) UpdateHook added in v0.1.28

func (s *GatewayService) UpdateHook(ctx context.Context, req *pb.UpdateHookRequest) (*pb.HookResponse, error)

type SourceService

type SourceService struct {
	pb.UnimplementedSourceServiceServer
	// contains filtered or unexported fields
}

SourceService implements the gRPC SourceService for integration access.

func NewSourceServiceWithOAuth

func NewSourceServiceWithOAuth(registry *sources.Registry, backend repository.BackendRepository, fsStore repository.FilesystemStore, oauthRegistry *oauth.Registry, opts ...SourceServiceOption) *SourceService

func (*SourceService) CreateSmartQuery

func (*SourceService) DeleteSmartQuery

func (*SourceService) ExecuteSmartQuery

ExecuteSmartQuery runs a query and returns materialized results.

func (*SourceService) GetSmartQuery

func (*SourceService) InvalidateConnectionCache added in v0.1.34

func (s *SourceService) InvalidateConnectionCache(workspaceId uint)

func (*SourceService) InvalidateQueryCache

func (s *SourceService) InvalidateQueryCache(ctx context.Context, workspaceId uint, queryPath string) error

InvalidateQueryCache invalidates cached results for a query path.

func (*SourceService) ListSmartQueries

func (*SourceService) Read

func (*SourceService) ReadBySourceURI added in v0.1.47

func (s *SourceService) ReadBySourceURI(ctx context.Context, workspaceId uint, memberId uint, sourceURI string) ([]byte, error)

ReadBySourceURI fetches content directly from a provider using a source URI of the form "integration://resultID". This bypasses the smart-folder layer entirely, so it works even if the query results have changed since the original read was recorded.

func (*SourceService) ReadDir

func (*SourceService) RefreshQuery added in v0.1.28

func (s *SourceService) RefreshQuery(ctx context.Context, query *types.FilesystemQuery) error

RefreshQuery re-executes a query and emits hook events for new results. Called ONLY by the source poller — never by user browsing or task reads. This prevents a feedback loop where hook-triggered tasks re-fire hooks.

func (*SourceService) RefreshSmartQuery

func (s *SourceService) RefreshSmartQuery(ctx context.Context, queryPath string) ([]repository.QueryResult, error)

RefreshSmartQuery forces re-execution of a smart query, bypassing all caches.

func (*SourceService) Stat

func (*SourceService) UpdateSmartQuery

type SourceServiceOption added in v0.1.28

type SourceServiceOption func(*SourceService)

func WithCompressionMiddleware added in v0.1.43

func WithCompressionMiddleware(
	compressor compression.ContextCompressor,
	store *compression.CompressedStore,
	cfg compression.Config,
) SourceServiceOption

func WithHookStream added in v0.1.28

func WithHookStream(emitter common.EventEmitter) SourceServiceOption

func WithRecorder added in v0.1.47

func WithRecorder(recorder instrumentation.AccessRecorder) SourceServiceOption

func WithSeenTracker added in v0.1.28

func WithSeenTracker(tracker *hooks.SeenTracker) SourceServiceOption

type StorageService

type StorageService struct {
	pb.UnimplementedContextServiceServer
	// contains filtered or unexported fields
}

StorageService provides S3-backed file storage with per-workspace buckets

func NewStorageService

func NewStorageService(client *clients.StorageClient, eventBus *common.EventBus) (*StorageService, error)

func (*StorageService) Create

Create creates an empty file

func (*StorageService) Delete

Delete removes a file or directory

func (*StorageService) GetDownloadURL

func (s *StorageService) GetDownloadURL(ctx context.Context, path string) (string, error)

GetDownloadURL generates a presigned GET URL for downloading a file

func (*StorageService) GetUploadURL

func (s *StorageService) GetUploadURL(ctx context.Context, path, contentType string) (string, string, error)

GetUploadURL generates a presigned PUT URL for uploading a file

func (*StorageService) InvalidateCache added in v0.1.14

func (s *StorageService) InvalidateCache(ctx context.Context, path string)

InvalidateCache clears the cache for a path (used when client requests fresh data)

func (*StorageService) ListTree

ListTree returns flat listing of subtree for prefetching

func (*StorageService) Mkdir

Mkdir creates a directory

func (*StorageService) NotifyUploadComplete

func (s *StorageService) NotifyUploadComplete(ctx context.Context, path string) error

NotifyUploadComplete invalidates caches after a file upload

func (*StorageService) Read

Read reads file content

func (*StorageService) ReadDir

ReadDir lists directory contents

Readlink reads symbolic link target

func (*StorageService) Rename

Rename moves/renames a file or directory

func (*StorageService) SetHookStream added in v0.1.28

func (s *StorageService) SetHookStream(emitter common.EventEmitter)

SetHookStream sets the event emitter for hook event emission.

func (*StorageService) Stat

Stat returns file/directory attributes

Symlink creates a symbolic link

func (*StorageService) Truncate

Truncate changes file size

func (*StorageService) Write

Write writes file content

type ToolService

type ToolService struct {
	pb.UnimplementedToolServiceServer
	// contains filtered or unexported fields
}

func NewToolService

func NewToolService(registry *tools.Registry) *ToolService

func NewToolServiceWithBackend

func NewToolServiceWithBackend(registry *tools.Registry, backend repository.BackendRepository) *ToolService

func NewToolServiceWithOAuth

func NewToolServiceWithOAuth(registry *tools.Registry, backend repository.BackendRepository, oauthRegistry *oauth.Registry) *ToolService

func (*ToolService) ExecuteTool

func (*ToolService) GetToolHelp

func (*ToolService) ListTools

func (*ToolService) Resolver

func (s *ToolService) Resolver() *tools.WorkspaceToolResolver

Resolver returns the workspace tool resolver for use by other components

type WorkerService

type WorkerService struct {
	pb.UnimplementedWorkerServiceServer
	// contains filtered or unexported fields
}

func NewWorkerService

func NewWorkerService(sched *scheduler.Scheduler, backend *repository.PostgresBackend, workerRepo repository.WorkerRepository) *WorkerService

func (*WorkerService) AllocateIP added in v0.1.23

func (*WorkerService) Deregister

func (*WorkerService) GetWorker

func (*WorkerService) Heartbeat

func (*WorkerService) ListWorkers added in v0.1.23

func (*WorkerService) RegisterWorker

func (*WorkerService) ReleaseIP added in v0.1.23

func (*WorkerService) SetTaskResult

func (*WorkerService) SetTaskStarted added in v0.1.28

func (*WorkerService) UpdateStatus

Jump to

Keyboard shortcuts

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