Documentation ¶
Index ¶
- type Endpoint
- type RemoteEndpointImpl
- func (e *RemoteEndpointImpl) GetEvictPods(c context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
- func (e *RemoteEndpointImpl) GetTopEvictionPods(c context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
- func (e *RemoteEndpointImpl) IsStopped() bool
- func (e *RemoteEndpointImpl) SetStopTime(t time.Time)
- func (e *RemoteEndpointImpl) Start()
- func (e *RemoteEndpointImpl) Stop()
- func (e *RemoteEndpointImpl) StopGracePeriodExpired() bool
- func (e *RemoteEndpointImpl) ThresholdMet(c context.Context) (*pluginapi.ThresholdMetResponse, error)
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 ¶
func (e *RemoteEndpointImpl) GetEvictPods(c context.Context, request *pluginapi.GetEvictPodsRequest) (*pluginapi.GetEvictPodsResponse, error)
GetEvictPods is used to call remote endpoint GetEvictPods
func (*RemoteEndpointImpl) GetTopEvictionPods ¶
func (e *RemoteEndpointImpl) GetTopEvictionPods(c context.Context, request *pluginapi.GetTopEvictionPodsRequest) (*pluginapi.GetTopEvictionPodsResponse, error)
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 ¶
func (e *RemoteEndpointImpl) ThresholdMet(c context.Context) (*pluginapi.ThresholdMetResponse, error)
ThresholdMet is used to call remote endpoint ThresholdMet