Documentation
¶
Index ¶
- type Config
- type Credentials
- type Instance
- type MockInstance
- func (_m *MockInstance) CheckPermissions(pluginName string, user *context.User, resource string, resourceGroup string, ...) error
- func (_m *MockInstance) ContainerInstancesClient() containerinstances.Client
- func (_m *MockInstance) CostManagementClient() costmanagement.Client
- func (_m *MockInstance) GetName() string
- func (_m *MockInstance) KubernetesServicesClient() kubernetesservices.Client
- func (_m *MockInstance) MonitorClient() monitor.Client
- func (_m *MockInstance) ResourceGroupsClient() resourcegroups.Client
- func (_m *MockInstance) VirtualMachineScaleSetsClient() virtualmachinescalesets.Client
- type NewMockInstanceT
- type Permissions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Credentials Credentials `json:"credentials"`
PermissionsEnabled bool `json:"permissionsEnabled"`
}
Config is the structure of the configuration for a single Azure instance.
type Credentials ¶
type Credentials struct {
SubscriptionID string `json:"subscriptionID"`
TenantID string `json:"tenantID"`
ClientID string `json:"clientID"`
ClientSecret string `json:"clientSecret"`
}
Credentials is the structure of the required information to authenticate against the Azure API.
type Instance ¶
type Instance interface {
GetName() string
ResourceGroupsClient() resourcegroups.Client
KubernetesServicesClient() kubernetesservices.Client
ContainerInstancesClient() containerinstances.Client
CostManagementClient() costmanagement.Client
VirtualMachineScaleSetsClient() virtualmachinescalesets.Client
MonitorClient() monitor.Client
CheckPermissions(pluginName string, user *authContext.User, resource, resourceGroup, verb string) error
}
Instance is the interface which must be implemented by an Azure instance.
type MockInstance ¶
MockInstance is an autogenerated mock type for the Instance type
func NewMockInstance ¶
func NewMockInstance(t NewMockInstanceT) *MockInstance
NewMockInstance creates a new instance of MockInstance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockInstance) CheckPermissions ¶
func (_m *MockInstance) CheckPermissions(pluginName string, user *context.User, resource string, resourceGroup string, verb string) error
CheckPermissions provides a mock function with given fields: pluginName, user, resource, resourceGroup, verb
func (*MockInstance) ContainerInstancesClient ¶
func (_m *MockInstance) ContainerInstancesClient() containerinstances.Client
ContainerInstancesClient provides a mock function with given fields:
func (*MockInstance) CostManagementClient ¶
func (_m *MockInstance) CostManagementClient() costmanagement.Client
CostManagementClient provides a mock function with given fields:
func (*MockInstance) GetName ¶
func (_m *MockInstance) GetName() string
GetName provides a mock function with given fields:
func (*MockInstance) KubernetesServicesClient ¶
func (_m *MockInstance) KubernetesServicesClient() kubernetesservices.Client
KubernetesServicesClient provides a mock function with given fields:
func (*MockInstance) MonitorClient ¶
func (_m *MockInstance) MonitorClient() monitor.Client
MonitorClient provides a mock function with given fields:
func (*MockInstance) ResourceGroupsClient ¶
func (_m *MockInstance) ResourceGroupsClient() resourcegroups.Client
ResourceGroupsClient provides a mock function with given fields:
func (*MockInstance) VirtualMachineScaleSetsClient ¶
func (_m *MockInstance) VirtualMachineScaleSetsClient() virtualmachinescalesets.Client
VirtualMachineScaleSetsClient provides a mock function with given fields:
type NewMockInstanceT ¶
type Permissions ¶
type Permissions struct {
Resources []string `json:"resources"`
ResourceGroups []string `json:"resourceGroups"`
Verbs []string `json:"verbs"`
}
Permissions is the structure of the custom permissions field for the Azure instance.