Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package server implements the Creel gRPC server.

Index

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. coverage:ignore - gRPC handler; tested via integration tests

func (*AdminServer) CreateSystemAccount

CreateSystemAccount creates a new system account and returns its initial API key. coverage:ignore - gRPC handler; tested via integration tests

func (*AdminServer) DeleteSystemAccount

DeleteSystemAccount deletes a system account and its keys. coverage:ignore - gRPC handler; tested via integration tests

func (*AdminServer) Health

Health checks database connectivity and returns server status. coverage:ignore - gRPC handler; tested via integration tests

func (*AdminServer) ListSystemAccounts

ListSystemAccounts lists all system accounts. coverage:ignore - gRPC handler; tested via integration tests

func (*AdminServer) RevokeKey

RevokeKey immediately revokes all active keys for the system account. coverage:ignore - gRPC handler; tested via integration tests

func (*AdminServer) RotateKey

RotateKey generates a new API key for the system account. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

func (*ChunkServer) DeleteChunk

DeleteChunk deletes a chunk and its embedding. Requires admin permission. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

func (*ChunkServer) IngestChunks

IngestChunks creates chunks and stores their embeddings. Requires write permission. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

func (*DocumentServer) DeleteDocument

DeleteDocument deletes a document. Requires admin permission on its topic. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

func (*DocumentServer) ListDocuments

ListDocuments lists documents in a topic. Requires read permission. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

func (*RetrievalServer) GetContext

GetContext returns Unimplemented (Phase 3). coverage:ignore - gRPC handler; tested via integration tests

func (*RetrievalServer) Search

Search performs ACL-filtered similarity search. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

func (*Server) GRPCServer

func (s *Server) GRPCServer() *grpc.Server

GRPCServer returns the underlying gRPC server for registering services. coverage:ignore - gRPC handler; tested via integration tests

func (*Server) GracefulStop

func (s *Server) GracefulStop()

GracefulStop gracefully shuts down the gRPC server. coverage:ignore - gRPC handler; tested via integration tests

func (*Server) Run

func (s *Server) Run() error

Run starts the gRPC server and blocks until it stops. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

func (*TopicServer) DeleteTopic

DeleteTopic deletes a topic with admin ACL check. Cascades to all content. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

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. coverage:ignore - gRPC handler; tested via integration tests

func (*TopicServer) ListGrants

ListGrants lists all grants for a topic. Requires read permission. coverage:ignore - gRPC handler; tested via integration tests

func (*TopicServer) ListTopics

ListTopics returns topics accessible to the authenticated principal. coverage:ignore - gRPC handler; tested via integration tests

func (*TopicServer) RevokeAccess

RevokeAccess revokes a principal's access to a topic. Requires admin permission. coverage:ignore - gRPC handler; tested via integration tests

func (*TopicServer) UpdateTopic

func (s *TopicServer) UpdateTopic(ctx context.Context, req *pb.UpdateTopicRequest) (*pb.Topic, error)

UpdateTopic updates a topic with admin ACL check. coverage:ignore - gRPC handler; tested via integration tests

Jump to

Keyboard shortcuts

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