mocks

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockAWSClient

type MockAWSClient struct {
	AWSAccountNumber       string
	License                types.GrantedLicense
	CheckedOutEntitlements map[string]int
	CheckoutTokenCtr       int
}

func NewMockAWSClient

func NewMockAWSClient(maxEntitlements int) *MockAWSClient

func (*MockAWSClient) AccountNumber

func (m *MockAWSClient) AccountNumber() string

func (*MockAWSClient) CheckInRancherLicense

func (m *MockAWSClient) CheckInRancherLicense(ctx context.Context, consumptionToken string) (*lm.CheckInLicenseOutput, error)

func (*MockAWSClient) CheckoutRancherLicense

func (m *MockAWSClient) CheckoutRancherLicense(ctx context.Context, l types.GrantedLicense, entitlementAmt int) (*lm.CheckoutLicenseOutput, error)

func (*MockAWSClient) ExtendRancherLicenseConsumptionToken

func (m *MockAWSClient) ExtendRancherLicenseConsumptionToken(ctx context.Context, consumptionToken string) (*lm.ExtendLicenseConsumptionOutput, error)

func (*MockAWSClient) GetNumberOfAvailableEntitlements

func (m *MockAWSClient) GetNumberOfAvailableEntitlements(ctx context.Context, license types.GrantedLicense) (int, error)

func (*MockAWSClient) GetRancherLicense

func (m *MockAWSClient) GetRancherLicense(ctx context.Context) (*types.GrantedLicense, error)

type MockK8sClient

type MockK8sClient struct {
	CurrentSecretData          map[string]string
	CurrentSupportConfig       []byte
	CurrentNotificationMessage string
	RancherHostName            string
	RancherVersion             string
}

func NewMockK8sClient

func NewMockK8sClient(secretData map[string]string) *MockK8sClient

func (*MockK8sClient) GetConsumptionTokenSecret

func (m *MockK8sClient) GetConsumptionTokenSecret() (*corev1.Secret, error)

func (*MockK8sClient) GetRancherHostname

func (m *MockK8sClient) GetRancherHostname() (string, error)

func (*MockK8sClient) GetRancherVersion

func (m *MockK8sClient) GetRancherVersion() (string, error)

func (*MockK8sClient) UpdateCSPConfigOutput

func (m *MockK8sClient) UpdateCSPConfigOutput(marshalledData []byte) error

func (*MockK8sClient) UpdateConsumptionTokenSecret

func (m *MockK8sClient) UpdateConsumptionTokenSecret(data map[string]string) error

func (*MockK8sClient) UpdateUserNotification

func (m *MockK8sClient) UpdateUserNotification(isInCompliance bool, message string) error

type MockScraper

type MockScraper struct {
	Nodes int
}

func NewMockScraper

func NewMockScraper(numNodes int) *MockScraper

func (*MockScraper) ScrapeAndParse

func (m *MockScraper) ScrapeAndParse() (*metrics.NodeCounts, error)

Jump to

Keyboard shortcuts

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