Documentation
¶
Index ¶
- func GetStubClient() client.TenantAwareInventoryClient
- type StubResponse
- type StubTenantAwareInventoryClient
- func (c *StubTenantAwareInventoryClient) Close() error
- func (c *StubTenantAwareInventoryClient) Create(ctx context.Context, tenantID string, res *inv_v1.Resource) (*inv_v1.Resource, error)
- func (c *StubTenantAwareInventoryClient) Delete(ctx context.Context, tenantID, id string) (*inv_v1.DeleteResourceResponse, error)
- func (c *StubTenantAwareInventoryClient) DeleteAllResources(ctx context.Context, tenantID string, kind inv_v1.ResourceKind, enforce bool) error
- func (c *StubTenantAwareInventoryClient) Find(ctx context.Context, filter *inv_v1.ResourceFilter) (*inv_v1.FindResourcesResponse, error)
- func (c *StubTenantAwareInventoryClient) FindAll(ctx context.Context, filter *inv_v1.ResourceFilter) ([]*client.ResourceTenantIDCarrier, error)
- func (c *StubTenantAwareInventoryClient) Get(ctx context.Context, tenantID, id string) (*inv_v1.GetResourceResponse, error)
- func (c *StubTenantAwareInventoryClient) GetHostByUUID(ctx context.Context, tenantID, uuid string) (*computev1.HostResource, error)
- func (c *StubTenantAwareInventoryClient) GetSitesPerRegion(ctx context.Context, request *inv_v1.GetSitesPerRegionRequest) (*inv_v1.GetSitesPerRegionResponse, error)
- func (c *StubTenantAwareInventoryClient) GetTreeHierarchy(ctx context.Context, request *inv_v1.GetTreeHierarchyRequest) ([]*inv_v1.GetTreeHierarchyResponse_TreeNode, error)
- func (c *StubTenantAwareInventoryClient) List(ctx context.Context, filter *inv_v1.ResourceFilter) (*inv_v1.ListResourcesResponse, error)
- func (c *StubTenantAwareInventoryClient) ListAll(ctx context.Context, filter *inv_v1.ResourceFilter) ([]*inv_v1.Resource, error)
- func (c *StubTenantAwareInventoryClient) ListInheritedTelemetryProfiles(ctx context.Context, tenantID string, ...) (*inv_v1.ListInheritedTelemetryProfilesResponse, error)
- func (c *StubTenantAwareInventoryClient) TestGetClientCache() *cache.InventoryCache
- func (c *StubTenantAwareInventoryClient) TestGetClientCacheUUID() *cache.InventoryCache
- func (c *StubTenantAwareInventoryClient) TestingOnlySetClient(client inv_v1.InventoryServiceClient)
- func (c *StubTenantAwareInventoryClient) Update(ctx context.Context, tenantID, id string, fm *fieldmaskpb.FieldMask, ...) (*inv_v1.Resource, error)
- func (c *StubTenantAwareInventoryClient) UpdateSubscriptions(ctx context.Context, tenantID string, kinds []inv_v1.ResourceKind) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStubClient ¶
func GetStubClient() client.TenantAwareInventoryClient
GetStubClient initializes the stub client with default responses and returns it
Types ¶
type StubResponse ¶
type StubResponse struct {
Response interface{}
Error error
}
StubResponse holds the response and error for a stubbed method call
type StubTenantAwareInventoryClient ¶
type StubTenantAwareInventoryClient struct {
StubbedResponses map[string]StubResponse
}
StubTenantAwareInventoryClient is a mock implementation of TenantAwareInventoryClient
func (*StubTenantAwareInventoryClient) Close ¶
func (c *StubTenantAwareInventoryClient) Close() error
Close is a stub implementation of the Close method
func (*StubTenantAwareInventoryClient) Create ¶
func (c *StubTenantAwareInventoryClient) Create( ctx context.Context, tenantID string, res *inv_v1.Resource, ) (*inv_v1.Resource, error)
Create returns a stubbed Resource based on tenantID and resource
func (*StubTenantAwareInventoryClient) Delete ¶
func (c *StubTenantAwareInventoryClient) Delete( ctx context.Context, tenantID, id string, ) (*inv_v1.DeleteResourceResponse, error)
Delete returns a stubbed DeleteResourceResponse based on tenantID and id
func (*StubTenantAwareInventoryClient) DeleteAllResources ¶
func (c *StubTenantAwareInventoryClient) DeleteAllResources( ctx context.Context, tenantID string, kind inv_v1.ResourceKind, enforce bool, ) error
DeleteAllResources is a stub implementation of the DeleteAllResources method
func (*StubTenantAwareInventoryClient) Find ¶
func (c *StubTenantAwareInventoryClient) Find( ctx context.Context, filter *inv_v1.ResourceFilter, ) (*inv_v1.FindResourcesResponse, error)
Find returns a stubbed FindResourcesResponse based on the filter
func (*StubTenantAwareInventoryClient) FindAll ¶
func (c *StubTenantAwareInventoryClient) FindAll( ctx context.Context, filter *inv_v1.ResourceFilter, ) ([]*client.ResourceTenantIDCarrier, error)
FindAll returns a stubbed list of ResourceTenantIDCarrier based on the filter
func (*StubTenantAwareInventoryClient) Get ¶
func (c *StubTenantAwareInventoryClient) Get( ctx context.Context, tenantID, id string, ) (*inv_v1.GetResourceResponse, error)
Get returns a stubbed GetResourceResponse based on tenantID and id
func (*StubTenantAwareInventoryClient) GetHostByUUID ¶
func (c *StubTenantAwareInventoryClient) GetHostByUUID( ctx context.Context, tenantID, uuid string, ) (*computev1.HostResource, error)
GetHostByUUID returns a stubbed HostResource based on tenantID and uuid
func (*StubTenantAwareInventoryClient) GetSitesPerRegion ¶
func (c *StubTenantAwareInventoryClient) GetSitesPerRegion( ctx context.Context, request *inv_v1.GetSitesPerRegionRequest, ) (*inv_v1.GetSitesPerRegionResponse, error)
GetSitesPerRegion returns a stubbed GetSitesPerRegionResponse based on the request
func (*StubTenantAwareInventoryClient) GetTreeHierarchy ¶
func (c *StubTenantAwareInventoryClient) GetTreeHierarchy( ctx context.Context, request *inv_v1.GetTreeHierarchyRequest, ) ([]*inv_v1.GetTreeHierarchyResponse_TreeNode, error)
GetTreeHierarchy returns a stubbed list of TreeNodes based on the request
func (*StubTenantAwareInventoryClient) List ¶
func (c *StubTenantAwareInventoryClient) List( ctx context.Context, filter *inv_v1.ResourceFilter, ) (*inv_v1.ListResourcesResponse, error)
List returns a stubbed ListResourcesResponse based on the filter
func (*StubTenantAwareInventoryClient) ListAll ¶
func (c *StubTenantAwareInventoryClient) ListAll( ctx context.Context, filter *inv_v1.ResourceFilter, ) ([]*inv_v1.Resource, error)
ListAll returns a stubbed list of Resources based on the filter
func (*StubTenantAwareInventoryClient) ListInheritedTelemetryProfiles ¶
func (c *StubTenantAwareInventoryClient) ListInheritedTelemetryProfiles( ctx context.Context, tenantID string, inheritBy *inv_v1.ListInheritedTelemetryProfilesRequest_InheritBy, filter, orderBy string, limit, offset uint32, ) (*inv_v1.ListInheritedTelemetryProfilesResponse, error)
ListInheritedTelemetryProfiles returns a stubbed ListInheritedTelemetryProfilesResponse
func (*StubTenantAwareInventoryClient) TestGetClientCache ¶
func (c *StubTenantAwareInventoryClient) TestGetClientCache() *cache.InventoryCache
TestGetClientCache is a stub implementation of the TestGetClientCache method
func (*StubTenantAwareInventoryClient) TestGetClientCacheUUID ¶
func (c *StubTenantAwareInventoryClient) TestGetClientCacheUUID() *cache.InventoryCache
TestGetClientCacheUUID is a stub implementation of the TestGetClientCacheUUID method
func (*StubTenantAwareInventoryClient) TestingOnlySetClient ¶
func (c *StubTenantAwareInventoryClient) TestingOnlySetClient( client inv_v1.InventoryServiceClient, )
TestingOnlySetClient is a stub implementation of the TestingOnlySetClient method
func (*StubTenantAwareInventoryClient) Update ¶
func (c *StubTenantAwareInventoryClient) Update( ctx context.Context, tenantID, id string, fm *fieldmaskpb.FieldMask, res *inv_v1.Resource, ) (*inv_v1.Resource, error)
Update returns a stubbed Resource based on tenantID, id, field mask, and resource
func (*StubTenantAwareInventoryClient) UpdateSubscriptions ¶
func (c *StubTenantAwareInventoryClient) UpdateSubscriptions( ctx context.Context, tenantID string, kinds []inv_v1.ResourceKind, ) error
UpdateSubscriptions is a stub implementation of the UpdateSubscriptions method