Documentation ¶
Overview ¶
Package slave provides the slave node of the bloader.
Index ¶
- Variables
- func Run(ctr *container.Container) error
- func StreamServerInterceptor(encrypter encrypt.Encrypter) grpc.StreamServerInterceptor
- func UnaryServerEncryptInterceptor(encrypter encrypt.Encrypter) grpc.UnaryServerInterceptor
- type AuthenticatorFactor
- type Output
- type OutputFactor
- type Server
- func (s *Server) CallExec(req *pb.CallExecRequest, ...) error
- func (s *Server) Connect(_ context.Context, req *pb.ConnectRequest) (*pb.ConnectResponse, error)
- func (s *Server) Disconnect(_ context.Context, req *pb.DisconnectRequest) (*pb.DisconnectResponse, error)
- func (s *Server) ReceiveChanelConnect(req *pb.ReceiveChanelConnectRequest, ...) error
- func (s *Server) ReceiveLoadTermChannel(ctx context.Context, req *pb.ReceiveLoadTermChannelRequest) (*pb.ReceiveLoadTermChannelResponse, error)
- func (s *Server) SendAuth(_ context.Context, req *pb.SendAuthRequest) (*pb.SendAuthResponse, error)
- func (s *Server) SendLoader(stream grpc.ClientStreamingServer[pb.SendLoaderRequest, pb.SendLoaderResponse]) error
- func (s *Server) SendStoreData(...) error
- func (s *Server) SendStoreOk(_ context.Context, req *pb.SendStoreOkRequest) (*pb.SendStoreOkResponse, error)
- func (s *Server) SendTarget(_ context.Context, req *pb.SendTargetRequest) (*pb.SendTargetResponse, error)
- func (s *Server) SlaveCommand(ctx context.Context, req *pb.SlaveCommandRequest) (*pb.SlaveCommandResponse, error)
- func (s *Server) SlaveCommandDefaultStore(stream ...) error
- type Store
- type TargetFactor
- type TmplFactor
Constants ¶
This section is empty.
Variables ¶
var ( // ErrRequestNotFound is returned when the request is not found ErrRequestNotFound = fmt.Errorf("request not found") // ErrInvalidConnectionID represents an error when the connection ID is invalid ErrInvalidConnectionID = fmt.Errorf("invalid connection ID") // ErrInvalidEnvironment represents an error when the environment is invalid ErrInvalidEnvironment = fmt.Errorf("must connect to the same environment") // ErrInvalidCommandID represents an error when the command ID is invalid ErrInvalidCommandID = fmt.Errorf("invalid command ID") // ErrLoaderNotFound represents an error when the loader is not found ErrLoaderNotFound = fmt.Errorf("loader not found") // ErrFailedToSendLoaderResourceRequest represents an error when the loader resource request is failed to send ErrFailedToSendLoaderResourceRequest = fmt.Errorf("failed to send loader resource request") // ErrCommandNotFound represents an error when the command is not found ErrCommandNotFound = fmt.Errorf("command not found") )
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(encrypter encrypt.Encrypter) grpc.StreamServerInterceptor
StreamServerInterceptor is a server-side interceptor that encrypts the request and decrypts the response.
func UnaryServerEncryptInterceptor ¶
func UnaryServerEncryptInterceptor(encrypter encrypt.Encrypter) grpc.UnaryServerInterceptor
UnaryServerEncryptInterceptor is a server-side interceptor that encrypts the request and decrypts the response.
Types ¶
type AuthenticatorFactor ¶
type AuthenticatorFactor struct {
// contains filtered or unexported fields
}
AuthenticatorFactor represents the slave authenticator factor
func (*AuthenticatorFactor) Factorize ¶
func (s *AuthenticatorFactor) Factorize( ctx context.Context, authID string, isDefault bool, ) (auth.SetAuthor, error)
Factorize returns the factorized authenticator
func (*AuthenticatorFactor) IsDefault ¶
func (s *AuthenticatorFactor) IsDefault(authID string) bool
IsDefault returns if the authenticator is the default authenticator
type Output ¶
type Output struct { // OutputID represents the output ID OutputID string // contains filtered or unexported fields }
Output represents the slave output service
func NewSlaveOutput ¶
func NewSlaveOutput(outputID string, outputChan chan<- *pb.CallExecResponse) Output
NewSlaveOutput creates a new SlaveOutput
type OutputFactor ¶
type OutputFactor struct {
// contains filtered or unexported fields
}
OutputFactor represents the factory
type Server ¶
type Server struct { pb.UnimplementedBloaderSlaveServiceServer // contains filtered or unexported fields }
Server represents the server for the worker node
func NewServer ¶
func NewServer(ctr *container.Container, slaveConCtr *runner.ConnectionContainer) *Server
NewServer creates a new server for the worker node
func (*Server) CallExec ¶
func (s *Server) CallExec(req *pb.CallExecRequest, stream grpc.ServerStreamingServer[pb.CallExecResponse]) error
CallExec handles the exec request from the master node
func (*Server) Connect ¶
func (s *Server) Connect(_ context.Context, req *pb.ConnectRequest) (*pb.ConnectResponse, error)
Connect handles the connection request from the master node
func (*Server) Disconnect ¶
func (s *Server) Disconnect(_ context.Context, req *pb.DisconnectRequest) (*pb.DisconnectResponse, error)
Disconnect handles the disconnection request from the master node
func (*Server) ReceiveChanelConnect ¶
func (s *Server) ReceiveChanelConnect( req *pb.ReceiveChanelConnectRequest, stream grpc.ServerStreamingServer[pb.ReceiveChanelConnectResponse], ) error
ReceiveChanelConnect handles the channel connection request from the master node
func (*Server) ReceiveLoadTermChannel ¶
func (s *Server) ReceiveLoadTermChannel( ctx context.Context, req *pb.ReceiveLoadTermChannelRequest, ) (*pb.ReceiveLoadTermChannelResponse, error)
ReceiveLoadTermChannel handles the load term channel request from the master node
func (*Server) SendAuth ¶
func (s *Server) SendAuth(_ context.Context, req *pb.SendAuthRequest) (*pb.SendAuthResponse, error)
SendAuth handles the auth request from the master node
func (*Server) SendLoader ¶
func (s *Server) SendLoader(stream grpc.ClientStreamingServer[pb.SendLoaderRequest, pb.SendLoaderResponse]) error
SendLoader handles the loader request from the master node
func (*Server) SendStoreData ¶
func (s *Server) SendStoreData( stream grpc.ClientStreamingServer[pb.SendStoreDataRequest, pb.SendStoreDataResponse], ) error
SendStoreData handles the store data request from the master node
func (*Server) SendStoreOk ¶
func (s *Server) SendStoreOk(_ context.Context, req *pb.SendStoreOkRequest) (*pb.SendStoreOkResponse, error)
SendStoreOk handles the store ok request from the master node
func (*Server) SendTarget ¶
func (s *Server) SendTarget(_ context.Context, req *pb.SendTargetRequest) (*pb.SendTargetResponse, error)
SendTarget handles the target request from the master node
func (*Server) SlaveCommand ¶
func (s *Server) SlaveCommand(ctx context.Context, req *pb.SlaveCommandRequest) (*pb.SlaveCommandResponse, error)
SlaveCommand handles the command request from the master node
func (*Server) SlaveCommandDefaultStore ¶
func (s *Server) SlaveCommandDefaultStore( stream grpc.ClientStreamingServer[ pb.SlaveCommandDefaultStoreRequest, pb.SlaveCommandDefaultStoreResponse, ], ) error
SlaveCommandDefaultStore handles the command default store request from the master node
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents the store for the slave node
func (*Store) Import ¶
func (s *Store) Import(ctx context.Context, data []runner.ValidStoreImportData, cb runner.ImportCallback) error
Import loads the data
func (*Store) Store ¶
func (s *Store) Store(ctx context.Context, data []runner.ValidStoreValueData, cb runner.StoreCallback) error
Store stores the data
func (*Store) StoreWithExtractor ¶
func (s *Store) StoreWithExtractor( ctx context.Context, res any, data []runner.ValidExecRequestStoreData, cb runner.StoreWithExtractorCallback, ) error
StoreWithExtractor stores the data with extractor
type TargetFactor ¶
type TargetFactor struct {
// contains filtered or unexported fields
}
TargetFactor represents the factory for the slave target
type TmplFactor ¶
type TmplFactor struct {
// contains filtered or unexported fields
}
TmplFactor represents the slave template factor
func (*TmplFactor) TmplFactorize ¶
TmplFactorize is a function that factorizes the template
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package slcontainer provides the container for the slave node
|
Package slcontainer provides the container for the slave node |