Documentation
¶
Overview ¶
Package server implements the Creel gRPC server.
Index ¶
- type AdminServer
- func (s *AdminServer) CreateSystemAccount(ctx context.Context, req *pb.CreateSystemAccountRequest) (*pb.CreateSystemAccountResponse, error)
- func (s *AdminServer) DeleteSystemAccount(ctx context.Context, req *pb.DeleteSystemAccountRequest) (*pb.DeleteSystemAccountResponse, error)
- func (s *AdminServer) Health(ctx context.Context, _ *pb.HealthRequest) (*pb.HealthResponse, error)
- func (s *AdminServer) ListSystemAccounts(ctx context.Context, _ *pb.ListSystemAccountsRequest) (*pb.ListSystemAccountsResponse, error)
- func (s *AdminServer) RevokeKey(ctx context.Context, req *pb.RevokeKeyRequest) (*pb.RevokeKeyResponse, error)
- func (s *AdminServer) RotateKey(ctx context.Context, req *pb.RotateKeyRequest) (*pb.RotateKeyResponse, error)
- type ChunkServer
- func (s *ChunkServer) DeleteChunk(ctx context.Context, req *pb.DeleteChunkRequest) (*pb.DeleteChunkResponse, error)
- func (s *ChunkServer) GetChunk(ctx context.Context, req *pb.GetChunkRequest) (*pb.Chunk, error)
- func (s *ChunkServer) IngestChunks(ctx context.Context, req *pb.IngestChunksRequest) (*pb.IngestChunksResponse, error)
- type DocumentServer
- func (s *DocumentServer) CreateDocument(ctx context.Context, req *pb.CreateDocumentRequest) (*pb.Document, error)
- func (s *DocumentServer) DeleteDocument(ctx context.Context, req *pb.DeleteDocumentRequest) (*pb.DeleteDocumentResponse, error)
- func (s *DocumentServer) GetDocument(ctx context.Context, req *pb.GetDocumentRequest) (*pb.Document, error)
- func (s *DocumentServer) ListDocuments(ctx context.Context, req *pb.ListDocumentsRequest) (*pb.ListDocumentsResponse, error)
- func (s *DocumentServer) UpdateDocument(ctx context.Context, req *pb.UpdateDocumentRequest) (*pb.Document, error)
- type RetrievalServer
- type Server
- type TopicServer
- func (s *TopicServer) CreateTopic(ctx context.Context, req *pb.CreateTopicRequest) (*pb.Topic, error)
- func (s *TopicServer) DeleteTopic(ctx context.Context, req *pb.DeleteTopicRequest) (*pb.DeleteTopicResponse, error)
- func (s *TopicServer) GetTopic(ctx context.Context, req *pb.GetTopicRequest) (*pb.Topic, error)
- func (s *TopicServer) GrantAccess(ctx context.Context, req *pb.GrantAccessRequest) (*pb.TopicGrant, error)
- func (s *TopicServer) ListGrants(ctx context.Context, req *pb.ListGrantsRequest) (*pb.ListGrantsResponse, error)
- func (s *TopicServer) ListTopics(ctx context.Context, _ *pb.ListTopicsRequest) (*pb.ListTopicsResponse, error)
- func (s *TopicServer) RevokeAccess(ctx context.Context, req *pb.RevokeAccessRequest) (*pb.RevokeAccessResponse, error)
- func (s *TopicServer) UpdateTopic(ctx context.Context, req *pb.UpdateTopicRequest) (*pb.Topic, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminServer ¶
type AdminServer struct {
pb.UnimplementedAdminServiceServer
// contains filtered or unexported fields
}
AdminServer implements the AdminService gRPC service.
func NewAdminServer ¶
func NewAdminServer(pool *pgxpool.Pool, accountStore *store.SystemAccountStore, version string) *AdminServer
NewAdminServer creates a new admin service.
func (*AdminServer) CreateSystemAccount ¶
func (s *AdminServer) CreateSystemAccount(ctx context.Context, req *pb.CreateSystemAccountRequest) (*pb.CreateSystemAccountResponse, error)
CreateSystemAccount creates a new system account and returns its initial API key.
func (*AdminServer) DeleteSystemAccount ¶
func (s *AdminServer) DeleteSystemAccount(ctx context.Context, req *pb.DeleteSystemAccountRequest) (*pb.DeleteSystemAccountResponse, error)
DeleteSystemAccount deletes a system account and its keys.
func (*AdminServer) Health ¶
func (s *AdminServer) Health(ctx context.Context, _ *pb.HealthRequest) (*pb.HealthResponse, error)
Health checks database connectivity and returns server status.
func (*AdminServer) ListSystemAccounts ¶
func (s *AdminServer) ListSystemAccounts(ctx context.Context, _ *pb.ListSystemAccountsRequest) (*pb.ListSystemAccountsResponse, error)
ListSystemAccounts lists all system accounts.
func (*AdminServer) RevokeKey ¶
func (s *AdminServer) RevokeKey(ctx context.Context, req *pb.RevokeKeyRequest) (*pb.RevokeKeyResponse, error)
RevokeKey immediately revokes all active keys for the system account.
func (*AdminServer) RotateKey ¶
func (s *AdminServer) RotateKey(ctx context.Context, req *pb.RotateKeyRequest) (*pb.RotateKeyResponse, error)
RotateKey generates a new API key for the system account.
type ChunkServer ¶
type ChunkServer struct {
pb.UnimplementedChunkServiceServer
// contains filtered or unexported fields
}
ChunkServer implements the ChunkService gRPC service.
func NewChunkServer ¶
func NewChunkServer(chunkStore *store.ChunkStore, docStore *store.DocumentStore, backend vector.Backend, authorizer auth.Authorizer) *ChunkServer
NewChunkServer creates a new chunk service.
func (*ChunkServer) DeleteChunk ¶
func (s *ChunkServer) DeleteChunk(ctx context.Context, req *pb.DeleteChunkRequest) (*pb.DeleteChunkResponse, error)
DeleteChunk deletes a chunk and its embedding. Requires admin permission.
func (*ChunkServer) GetChunk ¶
func (s *ChunkServer) GetChunk(ctx context.Context, req *pb.GetChunkRequest) (*pb.Chunk, error)
GetChunk retrieves a chunk. Requires read permission on its topic.
func (*ChunkServer) IngestChunks ¶
func (s *ChunkServer) IngestChunks(ctx context.Context, req *pb.IngestChunksRequest) (*pb.IngestChunksResponse, error)
IngestChunks creates chunks and stores their embeddings. Requires write permission.
type DocumentServer ¶
type DocumentServer struct {
pb.UnimplementedDocumentServiceServer
// contains filtered or unexported fields
}
DocumentServer implements the DocumentService gRPC service.
func NewDocumentServer ¶
func NewDocumentServer(docStore *store.DocumentStore, authorizer auth.Authorizer) *DocumentServer
NewDocumentServer creates a new document service.
func (*DocumentServer) CreateDocument ¶
func (s *DocumentServer) CreateDocument(ctx context.Context, req *pb.CreateDocumentRequest) (*pb.Document, error)
CreateDocument creates a new document. Requires write permission on the topic.
func (*DocumentServer) DeleteDocument ¶
func (s *DocumentServer) DeleteDocument(ctx context.Context, req *pb.DeleteDocumentRequest) (*pb.DeleteDocumentResponse, error)
DeleteDocument deletes a document. Requires admin permission on its topic.
func (*DocumentServer) GetDocument ¶
func (s *DocumentServer) GetDocument(ctx context.Context, req *pb.GetDocumentRequest) (*pb.Document, error)
GetDocument retrieves a document. Requires read permission on its topic.
func (*DocumentServer) ListDocuments ¶
func (s *DocumentServer) ListDocuments(ctx context.Context, req *pb.ListDocumentsRequest) (*pb.ListDocumentsResponse, error)
ListDocuments lists documents in a topic. Requires read permission.
func (*DocumentServer) UpdateDocument ¶
func (s *DocumentServer) UpdateDocument(ctx context.Context, req *pb.UpdateDocumentRequest) (*pb.Document, error)
UpdateDocument updates a document. Requires write permission on its topic.
type RetrievalServer ¶
type RetrievalServer struct {
pb.UnimplementedRetrievalServiceServer
// contains filtered or unexported fields
}
RetrievalServer implements the RetrievalService gRPC service.
func NewRetrievalServer ¶
func NewRetrievalServer(searcher *retrieval.Searcher) *RetrievalServer
NewRetrievalServer creates a new retrieval service.
func (*RetrievalServer) GetContext ¶
func (s *RetrievalServer) GetContext(_ context.Context, _ *pb.GetContextRequest) (*pb.GetContextResponse, error)
GetContext returns Unimplemented (Phase 3).
func (*RetrievalServer) Search ¶
func (s *RetrievalServer) Search(ctx context.Context, req *pb.SearchRequest) (*pb.SearchResponse, error)
Search performs ACL-filtered similarity search.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps a gRPC server with Creel services.
func New ¶
func New(port int, apiKeyValidator *auth.APIKeyValidator, oidcValidator *auth.OIDCValidator) *Server
New creates a new Server with auth interceptor and registers services.
func (*Server) GRPCServer ¶
GRPCServer returns the underlying gRPC server for registering services.
func (*Server) GracefulStop ¶
func (s *Server) GracefulStop()
GracefulStop gracefully shuts down the gRPC server.
type TopicServer ¶
type TopicServer struct {
pb.UnimplementedTopicServiceServer
// contains filtered or unexported fields
}
TopicServer implements the TopicService gRPC service.
func NewTopicServer ¶
func NewTopicServer(topicStore *store.TopicStore, authorizer auth.Authorizer) *TopicServer
NewTopicServer creates a new topic service.
func (*TopicServer) CreateTopic ¶
func (s *TopicServer) CreateTopic(ctx context.Context, req *pb.CreateTopicRequest) (*pb.Topic, error)
CreateTopic creates a new topic owned by the authenticated principal.
func (*TopicServer) DeleteTopic ¶
func (s *TopicServer) DeleteTopic(ctx context.Context, req *pb.DeleteTopicRequest) (*pb.DeleteTopicResponse, error)
DeleteTopic deletes a topic with admin ACL check. Cascades to all content.
func (*TopicServer) GetTopic ¶
func (s *TopicServer) GetTopic(ctx context.Context, req *pb.GetTopicRequest) (*pb.Topic, error)
GetTopic retrieves a topic by ID with ACL check.
func (*TopicServer) GrantAccess ¶
func (s *TopicServer) GrantAccess(ctx context.Context, req *pb.GrantAccessRequest) (*pb.TopicGrant, error)
GrantAccess grants a principal access to a topic. Requires admin permission.
func (*TopicServer) ListGrants ¶
func (s *TopicServer) ListGrants(ctx context.Context, req *pb.ListGrantsRequest) (*pb.ListGrantsResponse, error)
ListGrants lists all grants for a topic. Requires read permission.
func (*TopicServer) ListTopics ¶
func (s *TopicServer) ListTopics(ctx context.Context, _ *pb.ListTopicsRequest) (*pb.ListTopicsResponse, error)
ListTopics returns topics accessible to the authenticated principal.
func (*TopicServer) RevokeAccess ¶
func (s *TopicServer) RevokeAccess(ctx context.Context, req *pb.RevokeAccessRequest) (*pb.RevokeAccessResponse, error)
RevokeAccess revokes a principal's access to a topic. Requires admin permission.
func (*TopicServer) UpdateTopic ¶
func (s *TopicServer) UpdateTopic(ctx context.Context, req *pb.UpdateTopicRequest) (*pb.Topic, error)
UpdateTopic updates a topic with admin ACL check.