Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchesProto ¶
func New ¶
func New(t tiface.T) (*API, BaseResources)
New returns mock configured for most happy path tests. * Endpoints server returns mock server addr for all ids. * Credentials set to some OAuth token, and IAMToken server returns some IAM Token for it. * Resource manager configured to serve Get/List requests for one Cloud with one Folder.
Types ¶
type API ¶
type API struct { IAM IAM ResourceManager ResourceManager // Just add generated mock as a field: it will be initialized and served automagically. Compute Compute APIEndpoint APIEndpoint // contains filtered or unexported fields }
API is helper to mock public API on server side.
func (*API) MockEndpoint ¶
func (api *API) MockEndpoint()
func (*API) MockIAMToken ¶
func (api *API) MockIAMToken()
type APIEndpoint ¶
type APIEndpoint struct {
APIEndpoint *endpointmocks.ApiEndpointServiceServer
}
type BaseResources ¶
type Compute ¶
type Compute struct { Instance *computemocks.InstanceServiceServer Zone *computemocks.ZoneServiceServer Disk *computemocks.DiskServiceServer }
type IAM ¶
type IAM struct { IAMToken *iammocks.IamTokenServiceServer ServiceAccount *iammocks.ServiceAccountServiceServer }
type ResourceManager ¶
type ResourceManager struct { Cloud *resourcemanagermocks.CloudServiceServer Folder *resourcemanagermocks.FolderServiceServer }
func (*ResourceManager) MockCloud ¶
func (rm *ResourceManager) MockCloud() string
func (*ResourceManager) MockFolder ¶
func (rm *ResourceManager) MockFolder(cloudID string) string
Click to show internal directories.
Click to hide internal directories.