supervisorproxy

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package supervisorproxy package implements the supervisor interface and forwards the requests on this interface to a remote supervisor over an rpc call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestSupervisorLauncher

func NewTestSupervisorLauncher() supervisor.Supervisor

NewTestSupervisorLauncher creates a mock supervisor

Types

type ProxyInfo

type ProxyInfo struct {
	ExcludedIPs []string

	sync.Mutex
	// contains filtered or unexported fields
}

ProxyInfo is a struct used to store state for the remote launcher. it mirrors what is stored by the supervisor and also information to talk with the remote enforcer

func NewProxySupervisor

func NewProxySupervisor(collector collector.EventCollector, enforcer enforcer.PolicyEnforcer, rpchdl rpcwrapper.RPCClient) (*ProxyInfo, error)

NewProxySupervisor creates a new IptablesSupervisor launcher

func (*ProxyInfo) AddExcludedIPs

func (s *ProxyInfo) AddExcludedIPs(ips []string) error

AddExcludedIPs call addexcluded ip on the remote supervisor

func (*ProxyInfo) InitRemoteSupervisor

func (s *ProxyInfo) InitRemoteSupervisor(contextID string, puInfo *policy.PUInfo) error

InitRemoteSupervisor calls initsupervisor method on the remote

func (*ProxyInfo) SetTargetNetworks

func (s *ProxyInfo) SetTargetNetworks(networks []string) error

SetTargetNetworks sets the target networks in case of an update

func (*ProxyInfo) Start

func (s *ProxyInfo) Start() error

Start This method does nothing and is implemented for completeness THe work done is done in the InitRemoteSupervisor method in the remote enforcer

func (*ProxyInfo) Stop

func (s *ProxyInfo) Stop() error

Stop This method does nothing

func (*ProxyInfo) Supervise

func (s *ProxyInfo) Supervise(contextID string, puInfo *policy.PUInfo) error

Supervise Calls Supervise on the remote supervisor

func (*ProxyInfo) Unsupervise

func (s *ProxyInfo) Unsupervise(contextID string) error

Unsupervise exported stops enforcing policy for the given IP.

type TestSupervisorLauncher

type TestSupervisorLauncher interface {
	supervisor.Supervisor
}

TestSupervisorLauncher is a mock

Jump to

Keyboard shortcuts

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