Documentation ¶
Index ¶
- type GRPCServer
- type Server
- func (s *Server) Close() error
- func (s *Server) GetChangedOutputs(ctx context.Context, req *titandprotocol.GetChangedOutputsRequest) (*titandprotocol.GetChangedOutputsResponse, error)
- func (s *Server) Hello(ctx context.Context, req *titandprotocol.HelloRequest) (*titandprotocol.HelloResponse, error)
- func (s *Server) NotifyOutputsWritten(ctx context.Context, req *titandprotocol.NotifyOutputsWrittenRequest) (*titandprotocol.NotifyOutputsWrittenResponse, error)
- func (s *Server) OnFileWatchClosed()
- func (s *Server) OnFileWatchError(err error)
- func (s *Server) OnFileWatchEvent(ev filewatcher.Event)
- func (s *Server) Register(grpcServer GRPCServer)
- func (s *Server) Shutdown(ctx context.Context, req *titandprotocol.ShutdownRequest) (*titandprotocol.ShutdownResponse, error)
- func (s *Server) Status(ctx context.Context, req *titandprotocol.StatusRequest) (*titandprotocol.StatusResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCServer ¶
type GRPCServer interface { grpc.ServiceRegistrar GracefulStop() }
GRPCServer is the interface that the titan server needs to the underlying GRPC server. This lets the titan server register itself, as well as provides a hook for shutting down the server.
type Server ¶
type Server struct { titandprotocol.UnimplementedTurbodServer // contains filtered or unexported fields }
Server implements the GRPC serverside of TurbodServer Note for the future: we don't yet make use of titan.json or the package graph in the server. Once we do, we may need a layer of indirection between "the thing that responds to grpc requests" and "the thing that holds our persistent data structures" to handle changes in the underlying configuration.
func New ¶
func New(serverName string, logger hclog.Logger, repoRoot titanpath.AbsoluteSystemPath, titanVersion string, logFilePath titanpath.AbsoluteSystemPath) (*Server, error)
New returns a new instance of Server
func (*Server) GetChangedOutputs ¶
func (s *Server) GetChangedOutputs(ctx context.Context, req *titandprotocol.GetChangedOutputsRequest) (*titandprotocol.GetChangedOutputsResponse, error)
GetChangedOutputs implements the GetChangedOutputs rpc from titan.proto
func (*Server) Hello ¶
func (s *Server) Hello(ctx context.Context, req *titandprotocol.HelloRequest) (*titandprotocol.HelloResponse, error)
Hello implements the Hello rpc from titan.proto
func (*Server) NotifyOutputsWritten ¶
func (s *Server) NotifyOutputsWritten(ctx context.Context, req *titandprotocol.NotifyOutputsWrittenRequest) (*titandprotocol.NotifyOutputsWrittenResponse, error)
NotifyOutputsWritten implements the NotifyOutputsWritten rpc from titan.proto
func (*Server) OnFileWatchClosed ¶
func (s *Server) OnFileWatchClosed()
OnFileWatchClosed implements filewatcher.FileWatchClient.OnFileWatchClosed
func (*Server) OnFileWatchError ¶
OnFileWatchError implements filewatcher.FileWatchClient.OnFileWatchError
func (*Server) OnFileWatchEvent ¶
func (s *Server) OnFileWatchEvent(ev filewatcher.Event)
OnFileWatchEvent implements filewatcher.FileWatchClient.OnFileWatchEvent In the event that the root of the monorepo is deleted, shut down the server.
func (*Server) Register ¶
func (s *Server) Register(grpcServer GRPCServer)
Register registers this server to respond to GRPC requests
func (*Server) Shutdown ¶
func (s *Server) Shutdown(ctx context.Context, req *titandprotocol.ShutdownRequest) (*titandprotocol.ShutdownResponse, error)
Shutdown implements the Shutdown rpc from titan.proto
func (*Server) Status ¶
func (s *Server) Status(ctx context.Context, req *titandprotocol.StatusRequest) (*titandprotocol.StatusResponse, error)
Status implements the Status rpc from titan.proto