endpoint

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint interface {
	ThresholdMet(c context.Context) (*pluginapi.ThresholdMetResponse, error)
	// GetTopEvictionPods notice: this function only be called when plugin's threshold is met
	GetTopEvictionPods(c context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
	GetEvictPods(c context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
	Start()
	Stop()
	IsStopped() bool
	StopGracePeriodExpired() bool
}

Endpoint represents a single registered plugin. It is responsible for managing gRPC communications with the eviction plugin and caching eviction states.

type RemoteEndpointImpl

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

RemoteEndpointImpl is implement of a remote eviction plugin endpoint

func NewRemoteEndpointImpl

func NewRemoteEndpointImpl(socketPath, pluginName string) (*RemoteEndpointImpl, error)

NewRemoteEndpointImpl new a remote eviction plugin endpoint

func (*RemoteEndpointImpl) GetEvictPods

GetEvictPods is used to call remote endpoint GetEvictPods

func (*RemoteEndpointImpl) GetTopEvictionPods

GetTopEvictionPods is used to call remote endpoint GetTopEvictionPods

func (*RemoteEndpointImpl) IsStopped

func (e *RemoteEndpointImpl) IsStopped() bool

IsStopped check this Endpoint whether be called stop function before

func (*RemoteEndpointImpl) SetStopTime

func (e *RemoteEndpointImpl) SetStopTime(t time.Time)

SetStopTime is used for testing only

func (*RemoteEndpointImpl) Start added in v0.3.0

func (e *RemoteEndpointImpl) Start()

Start has no need do anything for now

func (*RemoteEndpointImpl) Stop

func (e *RemoteEndpointImpl) Stop()

Stop is used to stop this remote endpoint

func (*RemoteEndpointImpl) StopGracePeriodExpired

func (e *RemoteEndpointImpl) StopGracePeriodExpired() bool

StopGracePeriodExpired check if this Endpoint has been stopped and exceeded the grace period since the stop timestamp

func (*RemoteEndpointImpl) ThresholdMet

ThresholdMet is used to call remote endpoint ThresholdMet

Jump to

Keyboard shortcuts

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