Documentation ¶
Index ¶
- func LaunchRemoteEnforcer(service enforcer.PacketProcessor) error
- type CollectorImpl
- type Server
- func (s *Server) Enforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error
- func (s *Server) EnforcerExit(req rpcwrapper.Request, resp *rpcwrapper.Response) error
- func (s *Server) InitEnforcer(req rpcwrapper.Request, resp *rpcwrapper.Response) error
- func (s *Server) InitSupervisor(req rpcwrapper.Request, resp *rpcwrapper.Response) error
- func (s *Server) Supervise(req rpcwrapper.Request, resp *rpcwrapper.Response) error
- func (s *Server) Unenforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error
- func (s *Server) Unsupervise(req rpcwrapper.Request, resp *rpcwrapper.Response) error
- type Stats
- type StatsClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LaunchRemoteEnforcer ¶
func LaunchRemoteEnforcer(service enforcer.PacketProcessor) error
LaunchRemoteEnforcer is a fake implementation for building on darwin.
Types ¶
type CollectorImpl ¶
type CollectorImpl struct { Flows map[string]*collector.FlowRecord sync.Mutex }
CollectorImpl : This is a local implementation for the collector interface It has a flow entries cache which contains unique flows that are reported back to the controller/launcher process
func NewCollector ¶
func NewCollector() *CollectorImpl
NewCollector creates a new remote collector for statistics
func (*CollectorImpl) CollectContainerEvent ¶
func (c *CollectorImpl) CollectContainerEvent(record *collector.ContainerRecord)
CollectContainerEvent exported This event should not be expected here in the enforcer process inside a particular container context
func (*CollectorImpl) CollectFlowEvent ¶
func (c *CollectorImpl) CollectFlowEvent(record *collector.FlowRecord)
CollectFlowEvent collects a new flow event and adds it to a local list it shares with SendStats
type Server ¶
type Server struct { Enforcer enforcer.PolicyEnforcer Supervisor supervisor.Supervisor Service enforcer.PacketProcessor // contains filtered or unexported fields }
Server is a fake implementation for building on darwin.
func NewServer ¶
func NewServer(service enforcer.PacketProcessor, rpchdl rpcwrapper.RPCServer, pcchan string, secret string, stats Stats) (*Server, error)
NewServer is a fake implementation for building on darwin.
func (*Server) Enforce ¶ added in v1.0.44
func (s *Server) Enforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error
Enforce this method calls the enforce method on the enforcer created during initenforcer
func (*Server) EnforcerExit ¶
func (s *Server) EnforcerExit(req rpcwrapper.Request, resp *rpcwrapper.Response) error
EnforcerExit this method is called when we received a killrpocess message from the controller This allows a graceful exit of the enforcer
func (*Server) InitEnforcer ¶ added in v1.0.44
func (s *Server) InitEnforcer(req rpcwrapper.Request, resp *rpcwrapper.Response) error
InitEnforcer is a function called from the controller using RPC. It intializes data structure required by the remote enforcer
func (*Server) InitSupervisor ¶ added in v1.0.44
func (s *Server) InitSupervisor(req rpcwrapper.Request, resp *rpcwrapper.Response) error
InitSupervisor is a function called from the controller over RPC. It initializes data structure required by the supervisor
func (*Server) Supervise ¶ added in v1.0.44
func (s *Server) Supervise(req rpcwrapper.Request, resp *rpcwrapper.Response) error
Supervise This method calls the supervisor method on the supervisor created during initsupervisor
func (*Server) Unenforce ¶ added in v1.0.44
func (s *Server) Unenforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error
Unenforce this method calls the unenforce method on the enforcer created from initenforcer
func (*Server) Unsupervise ¶ added in v1.0.44
func (s *Server) Unsupervise(req rpcwrapper.Request, resp *rpcwrapper.Response) error
Unsupervise This method calls the unsupervise method on the supervisor created during initsupervisor
type Stats ¶ added in v1.0.30
type Stats interface { SendStats() ConnectStatsClient() error Stop() }
Stats interface which implements StatsClient struct
func NewStatsClient ¶
NewStatsClient initializes a new stats client
type StatsClient ¶
type StatsClient struct {
// contains filtered or unexported fields
}
StatsClient This is the struct for storing state for the rpc client which reports flow stats back to the controller process
func (*StatsClient) ConnectStatsClient ¶ added in v1.0.30
func (s *StatsClient) ConnectStatsClient() error
ConnectStatsClient This is an private function called by the remoteenforcer to connect back to the controller over a stats channel
func (*StatsClient) SendStats ¶
func (s *StatsClient) SendStats()
SendStats async function which makes a rpc call to send stats every STATS_INTERVAL