policysync

package
v3.1.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SockName       = "/policysync.sock"
	OrchestratorId = "k8s"
	EndpointId     = "eth0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointInfo

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

type JoinMetadata

type JoinMetadata struct {
	EndpointID proto.WorkloadEndpointID
	// JoinUID is a correlator, used to match stop requests with join requests.
	JoinUID uint64
}

type JoinRequest

type JoinRequest struct {
	JoinMetadata
	// C is the channel to send updates to the policy sync client.  Processor closes the channel when the
	// workload endpoint is removed, or when a new JoinRequest is received for the same endpoint.  If nil, indicates
	// the client wants to stop receiving updates.
	C chan<- proto.ToDataplane
}

JoinRequest is sent to the Processor when a new socket connection is accepted by the GRPC server, it provides the channel used to send sync messages back to the server goroutine.

type LeaveRequest

type LeaveRequest struct {
	JoinMetadata
}

type Processor

type Processor struct {
	Updates     <-chan interface{}
	JoinUpdates chan interface{}
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor(updates <-chan interface{}) *Processor

func (*Processor) Start

func (p *Processor) Start()

type Server

type Server struct {
	JoinUpdates chan<- interface{}
	// contains filtered or unexported fields
}

Server implements the API that each policy-sync agent connects to in order to get policy information. There is a single instance of the Server, it disambiguates connections from different clients by the credentials present in the gRPC request.

func NewServer

func NewServer(joins chan<- interface{}, allocUID func() uint64) *Server

func (*Server) RegisterGrpc

func (s *Server) RegisterGrpc(g *grpc.Server)

func (*Server) Sync

type UIDAllocator

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

func NewUIDAllocator

func NewUIDAllocator() *UIDAllocator

func (*UIDAllocator) NextUID

func (a *UIDAllocator) NextUID() uint64

Jump to

Keyboard shortcuts

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