Documentation ¶
Index ¶
- func StartFileshareManagementLoop() (chan<- FileshareManagementMsg, <-chan interface{})
- func WaitForLogout(username string, logoutChan chan<- interface{}) error
- type FileshareManagementMsg
- type NorduserProcessMonitor
- type Server
- func (s *Server) Ping(context.Context, *pb.Empty) (*pb.Empty, error)
- func (s *Server) StartFileshare(context.Context, *pb.Empty) (*pb.Empty, error)
- func (s *Server) Stop(_ context.Context, req *pb.StopNorduserRequest) (*pb.Empty, error)
- func (s *Server) StopFileshare(context.Context, *pb.Empty) (*pb.Empty, error)
- type StartNorduserdMiddleware
- type StopRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartFileshareManagementLoop ¶
func StartFileshareManagementLoop() (chan<- FileshareManagementMsg, <-chan interface{})
StartFileshareManagementLoop starts the management loop in separate goroutine and returns a control channel and a shutdown channel. Management loop will try to disable fileshare and close the shutdown chan when Shutdown message is received.
func WaitForLogout ¶
WaitForLogout will send over logoutChan when user under the username logs out(i.e there are no remaining user processes for that user).
Types ¶
type FileshareManagementMsg ¶
type FileshareManagementMsg int
const ( Start FileshareManagementMsg = iota Stop Shutdown )
type NorduserProcessMonitor ¶
type NorduserProcessMonitor struct {
// contains filtered or unexported fields
}
NorduserProcessMonitor monitors the nordvpn system group and starts/stops norduserd for users added/removed from the group.
func NewNorduserProcessMonitor ¶
func NewNorduserProcessMonitor(service service.Service) NorduserProcessMonitor
func (*NorduserProcessMonitor) Start ¶
func (n *NorduserProcessMonitor) Start() error
Start blocks the thread and starts monitoring for changes in the nordvpn group.
func (*NorduserProcessMonitor) StartSnap ¶
func (n *NorduserProcessMonitor) StartSnap() error
StartSnap starts a simplified norduser process monitor routine. norduser processes will be stopped for users removed form the nordvpn group, no other actions will be taken. Because of snap, starting/restarting the process has to be handled in the process itself.
type Server ¶
type Server struct { pb.UnimplementedNorduserServer // contains filtered or unexported fields }
func NewServer ¶
func NewServer(fileshareManagementChan chan<- FileshareManagementMsg, stopChan chan<- StopRequest) *Server
func (*Server) StartFileshare ¶
type StartNorduserdMiddleware ¶
type StartNorduserdMiddleware struct {
// contains filtered or unexported fields
}
StartNorduserdMiddleware provides a way to start/stop norduserd when handling nordvpnd gRPCs.
func NewStartNorduserMiddleware ¶
func NewStartNorduserMiddleware(norduserd_service service.Service) StartNorduserdMiddleware
func (*StartNorduserdMiddleware) StreamMiddleware ¶
func (n *StartNorduserdMiddleware) StreamMiddleware(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo) error
func (*StartNorduserdMiddleware) UnaryMiddleware ¶
func (n *StartNorduserdMiddleware) UnaryMiddleware( ctx context.Context, req interface{}, info *grpc.UnaryServerInfo) (interface{}, error)