policyexample

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomPolicyResolver

type CustomPolicyResolver struct {
	// contains filtered or unexported fields
}

CustomPolicyResolver is a simple policy engine

func NewCustomPolicyResolver

func NewCustomPolicyResolver(networks []string) *CustomPolicyResolver

NewCustomPolicyResolver creates a new example policy engine for the Trireme package

func (*CustomPolicyResolver) HandlePUEvent

func (p *CustomPolicyResolver) HandlePUEvent(context string, eventType monitor.Event)

HandlePUEvent implements the corresponding interface. We have no state in this example

func (*CustomPolicyResolver) ResolvePolicy

func (p *CustomPolicyResolver) ResolvePolicy(context string, runtimeInfo policy.RuntimeReader) (*policy.PUPolicy, error)

ResolvePolicy implements the Trireme interface. Here we just create a simple policy that accepts packets with the same labels as the target container. We also add some egress/ingress services

func (*CustomPolicyResolver) SetPolicyUpdater

func (p *CustomPolicyResolver) SetPolicyUpdater(pu trireme.PolicyUpdater) error

SetPolicyUpdater is used in order to register a pointer to the policyUpdater We don't implement policy updates in this example

Jump to

Keyboard shortcuts

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