Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(clientset *kubernetes.Clientset) *Client
func (*Client) NodeMetrics ¶
type ClientInterface ¶
type ClientInterface interface {
NodeMetrics(ctx context.Context, nodeName string) (NodeMetrics, error)
}
type ClientMock ¶
type ClientMock struct { // NodeMetricsFunc mocks the NodeMetrics method. NodeMetricsFunc func(ctx context.Context, nodeName string) (NodeMetrics, error) // contains filtered or unexported fields }
ClientMock is a mock implementation of ClientInterface.
func TestSomethingThatUsesClientInterface(t *testing.T) { // make and configure a mocked ClientInterface mockedClientInterface := &ClientMock{ NodeMetricsFunc: func(ctx context.Context, nodeName string) (NodeMetrics, error) { panic("mock out the NodeMetrics method") }, } // use mockedClientInterface in code that requires ClientInterface // and then make assertions. }
func (*ClientMock) NodeMetrics ¶
func (mock *ClientMock) NodeMetrics(ctx context.Context, nodeName string) (NodeMetrics, error)
NodeMetrics calls NodeMetricsFunc.
func (*ClientMock) NodeMetricsCalls ¶
func (mock *ClientMock) NodeMetricsCalls() []struct { Ctx context.Context NodeName string }
NodeMetricsCalls gets all the calls that were made to NodeMetrics. Check the length with:
len(mockedClientInterface.NodeMetricsCalls())
type MetricValue ¶
type NodeMetrics ¶
type PodMetric ¶
type PodMetric map[PodKey]MetricValue
Click to show internal directories.
Click to hide internal directories.