Documentation
¶
Index ¶
- func Exec(t *testing.T, env *TestEnv, args ...string) (stdout, stderr string, err error)
- func FindContextEntry(t *testing.T, path, name string) *config.ContextEntry
- func WriteConfigFile(t *testing.T, dir string, content map[string]any) string
- func WriteContextConfigFile(t *testing.T, dir, currentContext string, ...) string
- func WriteYAMLConfigFile(t *testing.T, dir string, content map[string]any) string
- type FakeAccountService
- func (f *FakeAccountService) CreateAccountInvite(ctx context.Context, req *accountv1.CreateAccountInviteRequest) (*accountv1.CreateAccountInviteResponse, error)
- func (f *FakeAccountService) DeleteAccountInvite(ctx context.Context, req *accountv1.DeleteAccountInviteRequest) (*accountv1.DeleteAccountInviteResponse, error)
- func (f *FakeAccountService) GetAccount(ctx context.Context, req *accountv1.GetAccountRequest) (*accountv1.GetAccountResponse, error)
- func (f *FakeAccountService) GetAccountInvite(ctx context.Context, req *accountv1.GetAccountInviteRequest) (*accountv1.GetAccountInviteResponse, error)
- func (f *FakeAccountService) GetAccountMember(ctx context.Context, req *accountv1.GetAccountMemberRequest) (*accountv1.GetAccountMemberResponse, error)
- func (f *FakeAccountService) ListAccountInvites(ctx context.Context, req *accountv1.ListAccountInvitesRequest) (*accountv1.ListAccountInvitesResponse, error)
- func (f *FakeAccountService) ListAccountMembers(ctx context.Context, req *accountv1.ListAccountMembersRequest) (*accountv1.ListAccountMembersResponse, error)
- func (f *FakeAccountService) ListAccounts(ctx context.Context, req *accountv1.ListAccountsRequest) (*accountv1.ListAccountsResponse, error)
- func (f *FakeAccountService) UpdateAccount(ctx context.Context, req *accountv1.UpdateAccountRequest) (*accountv1.UpdateAccountResponse, error)
- type FakeAuthService
- func (f *FakeAuthService) CreateManagementKey(ctx context.Context, req *authv1.CreateManagementKeyRequest) (*authv1.CreateManagementKeyResponse, error)
- func (f *FakeAuthService) DeleteManagementKey(ctx context.Context, req *authv1.DeleteManagementKeyRequest) (*authv1.DeleteManagementKeyResponse, error)
- func (f *FakeAuthService) ListManagementKeys(ctx context.Context, req *authv1.ListManagementKeysRequest) (*authv1.ListManagementKeysResponse, error)
- type FakeBackupService
- func (f *FakeBackupService) CreateBackup(ctx context.Context, req *backupv1.CreateBackupRequest) (*backupv1.CreateBackupResponse, error)
- func (f *FakeBackupService) CreateBackupSchedule(ctx context.Context, req *backupv1.CreateBackupScheduleRequest) (*backupv1.CreateBackupScheduleResponse, error)
- func (f *FakeBackupService) DeleteBackup(ctx context.Context, req *backupv1.DeleteBackupRequest) (*backupv1.DeleteBackupResponse, error)
- func (f *FakeBackupService) DeleteBackupSchedule(ctx context.Context, req *backupv1.DeleteBackupScheduleRequest) (*backupv1.DeleteBackupScheduleResponse, error)
- func (f *FakeBackupService) GetBackup(ctx context.Context, req *backupv1.GetBackupRequest) (*backupv1.GetBackupResponse, error)
- func (f *FakeBackupService) GetBackupSchedule(ctx context.Context, req *backupv1.GetBackupScheduleRequest) (*backupv1.GetBackupScheduleResponse, error)
- func (f *FakeBackupService) ListBackupRestores(ctx context.Context, req *backupv1.ListBackupRestoresRequest) (*backupv1.ListBackupRestoresResponse, error)
- func (f *FakeBackupService) ListBackupSchedules(ctx context.Context, req *backupv1.ListBackupSchedulesRequest) (*backupv1.ListBackupSchedulesResponse, error)
- func (f *FakeBackupService) ListBackups(ctx context.Context, req *backupv1.ListBackupsRequest) (*backupv1.ListBackupsResponse, error)
- func (f *FakeBackupService) RestoreBackup(ctx context.Context, req *backupv1.RestoreBackupRequest) (*backupv1.RestoreBackupResponse, error)
- func (f *FakeBackupService) UpdateBackupSchedule(ctx context.Context, req *backupv1.UpdateBackupScheduleRequest) (*backupv1.UpdateBackupScheduleResponse, error)
- type FakeBookingService
- type FakeClusterService
- func (f *FakeClusterService) CreateCluster(ctx context.Context, req *clusterv1.CreateClusterRequest) (*clusterv1.CreateClusterResponse, error)
- func (f *FakeClusterService) CreateClusterFromBackup(ctx context.Context, req *clusterv1.CreateClusterFromBackupRequest) (*clusterv1.CreateClusterFromBackupResponse, error)
- func (f *FakeClusterService) DeleteCluster(ctx context.Context, req *clusterv1.DeleteClusterRequest) (*clusterv1.DeleteClusterResponse, error)
- func (f *FakeClusterService) GetCluster(ctx context.Context, req *clusterv1.GetClusterRequest) (*clusterv1.GetClusterResponse, error)
- func (f *FakeClusterService) ListClusters(ctx context.Context, req *clusterv1.ListClustersRequest) (*clusterv1.ListClustersResponse, error)
- func (f *FakeClusterService) ListQdrantReleases(ctx context.Context, req *clusterv1.ListQdrantReleasesRequest) (*clusterv1.ListQdrantReleasesResponse, error)
- func (f *FakeClusterService) RestartCluster(ctx context.Context, req *clusterv1.RestartClusterRequest) (*clusterv1.RestartClusterResponse, error)
- func (f *FakeClusterService) SuggestClusterName(ctx context.Context, req *clusterv1.SuggestClusterNameRequest) (*clusterv1.SuggestClusterNameResponse, error)
- func (f *FakeClusterService) SuspendCluster(ctx context.Context, req *clusterv1.SuspendClusterRequest) (*clusterv1.SuspendClusterResponse, error)
- func (f *FakeClusterService) UnsuspendCluster(ctx context.Context, req *clusterv1.UnsuspendClusterRequest) (*clusterv1.UnsuspendClusterResponse, error)
- func (f *FakeClusterService) UpdateCluster(ctx context.Context, req *clusterv1.UpdateClusterRequest) (*clusterv1.UpdateClusterResponse, error)
- type FakeDatabaseApiKeyService
- func (f *FakeDatabaseApiKeyService) CreateDatabaseApiKey(ctx context.Context, req *clusterauthv2.CreateDatabaseApiKeyRequest) (*clusterauthv2.CreateDatabaseApiKeyResponse, error)
- func (f *FakeDatabaseApiKeyService) DeleteDatabaseApiKey(ctx context.Context, req *clusterauthv2.DeleteDatabaseApiKeyRequest) (*clusterauthv2.DeleteDatabaseApiKeyResponse, error)
- func (f *FakeDatabaseApiKeyService) ListDatabaseApiKeys(ctx context.Context, req *clusterauthv2.ListDatabaseApiKeysRequest) (*clusterauthv2.ListDatabaseApiKeysResponse, error)
- type FakeHybridService
- func (f *FakeHybridService) CreateHybridCloudEnvironment(ctx context.Context, req *hybridv1.CreateHybridCloudEnvironmentRequest) (*hybridv1.CreateHybridCloudEnvironmentResponse, error)
- func (f *FakeHybridService) DeleteHybridCloudEnvironment(ctx context.Context, req *hybridv1.DeleteHybridCloudEnvironmentRequest) (*hybridv1.DeleteHybridCloudEnvironmentResponse, error)
- func (f *FakeHybridService) GenerateBootstrapCommands(ctx context.Context, req *hybridv1.GenerateBootstrapCommandsRequest) (*hybridv1.GenerateBootstrapCommandsResponse, error)
- func (f *FakeHybridService) GetHybridCloudEnvironment(ctx context.Context, req *hybridv1.GetHybridCloudEnvironmentRequest) (*hybridv1.GetHybridCloudEnvironmentResponse, error)
- func (f *FakeHybridService) ListHybridCloudEnvironments(ctx context.Context, req *hybridv1.ListHybridCloudEnvironmentsRequest) (*hybridv1.ListHybridCloudEnvironmentsResponse, error)
- func (f *FakeHybridService) UpdateHybridCloudEnvironment(ctx context.Context, req *hybridv1.UpdateHybridCloudEnvironmentRequest) (*hybridv1.UpdateHybridCloudEnvironmentResponse, error)
- type FakeIAMService
- func (f *FakeIAMService) AssignUserRoles(ctx context.Context, req *iamv1.AssignUserRolesRequest) (*iamv1.AssignUserRolesResponse, error)
- func (f *FakeIAMService) CreateRole(ctx context.Context, req *iamv1.CreateRoleRequest) (*iamv1.CreateRoleResponse, error)
- func (f *FakeIAMService) DeleteRole(ctx context.Context, req *iamv1.DeleteRoleRequest) (*iamv1.DeleteRoleResponse, error)
- func (f *FakeIAMService) GetAuthenticatedUser(ctx context.Context, req *iamv1.GetAuthenticatedUserRequest) (*iamv1.GetAuthenticatedUserResponse, error)
- func (f *FakeIAMService) GetRole(ctx context.Context, req *iamv1.GetRoleRequest) (*iamv1.GetRoleResponse, error)
- func (f *FakeIAMService) ListPermissions(ctx context.Context, req *iamv1.ListPermissionsRequest) (*iamv1.ListPermissionsResponse, error)
- func (f *FakeIAMService) ListRoles(ctx context.Context, req *iamv1.ListRolesRequest) (*iamv1.ListRolesResponse, error)
- func (f *FakeIAMService) ListUserRoles(ctx context.Context, req *iamv1.ListUserRolesRequest) (*iamv1.ListUserRolesResponse, error)
- func (f *FakeIAMService) ListUsers(ctx context.Context, req *iamv1.ListUsersRequest) (*iamv1.ListUsersResponse, error)
- func (f *FakeIAMService) UpdateRole(ctx context.Context, req *iamv1.UpdateRoleRequest) (*iamv1.UpdateRoleResponse, error)
- type FakeMonitoringService
- type FakePlatformService
- func (f *FakePlatformService) ListCloudProviderRegions(ctx context.Context, req *platformv1.ListCloudProviderRegionsRequest) (*platformv1.ListCloudProviderRegionsResponse, error)
- func (f *FakePlatformService) ListCloudProviders(ctx context.Context, req *platformv1.ListCloudProvidersRequest) (*platformv1.ListCloudProvidersResponse, error)
- type MethodSpy
- func (m *MethodSpy[Req, Resp]) All() []Req
- func (m *MethodSpy[Req, Resp]) Always(fn func(context.Context, Req) (Resp, error)) *MethodSpy[Req, Resp]
- func (m *MethodSpy[Req, Resp]) Count() int
- func (m *MethodSpy[Req, Resp]) Last() (Req, bool)
- func (m *MethodSpy[Req, Resp]) OnCall(i int, fn func(context.Context, Req) (Resp, error)) *MethodSpy[Req, Resp]
- func (m *MethodSpy[Req, Resp]) Reset()
- func (m *MethodSpy[Req, Resp]) Returns(resp Resp, err error) *MethodSpy[Req, Resp]
- type Option
- type RequestCapture
- type TestEnv
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
Exec builds and executes the root command with the given args, returning captured stdout, stderr, and any error from cmd.Execute().
func FindContextEntry ¶
func FindContextEntry(t *testing.T, path, name string) *config.ContextEntry
FindContextEntry reads the YAML config file at path and returns a pointer to the ContextEntry whose Name matches name, or nil if not found.
func WriteConfigFile ¶
WriteConfigFile marshals content as JSON and writes it to dir/config.json. Returns the full path for use with --config or QDRANT_CLOUD_CONFIG.
func WriteContextConfigFile ¶
func WriteContextConfigFile(t *testing.T, dir, currentContext string, contexts map[string]map[string]string) string
WriteContextConfigFile writes a context-format YAML config file to dir/config.yaml. Contexts are written as a YAML slice (- name: ...) sorted by name for deterministic output. Returns the full path for use with --config or QDRANT_CLOUD_CONFIG.
Types ¶
type FakeAccountService ¶ added in v0.20.0
type FakeAccountService struct {
accountv1.UnimplementedAccountServiceServer
ListAccountInvitesCalls MethodSpy[*accountv1.ListAccountInvitesRequest, *accountv1.ListAccountInvitesResponse]
GetAccountInviteCalls MethodSpy[*accountv1.GetAccountInviteRequest, *accountv1.GetAccountInviteResponse]
CreateAccountInviteCalls MethodSpy[*accountv1.CreateAccountInviteRequest, *accountv1.CreateAccountInviteResponse]
DeleteAccountInviteCalls MethodSpy[*accountv1.DeleteAccountInviteRequest, *accountv1.DeleteAccountInviteResponse]
ListAccountsCalls MethodSpy[*accountv1.ListAccountsRequest, *accountv1.ListAccountsResponse]
GetAccountCalls MethodSpy[*accountv1.GetAccountRequest, *accountv1.GetAccountResponse]
UpdateAccountCalls MethodSpy[*accountv1.UpdateAccountRequest, *accountv1.UpdateAccountResponse]
ListAccountMembersCalls MethodSpy[*accountv1.ListAccountMembersRequest, *accountv1.ListAccountMembersResponse]
GetAccountMemberCalls MethodSpy[*accountv1.GetAccountMemberRequest, *accountv1.GetAccountMemberResponse]
}
FakeAccountService is a test fake that implements AccountServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeAccountService) CreateAccountInvite ¶ added in v0.20.0
func (f *FakeAccountService) CreateAccountInvite(ctx context.Context, req *accountv1.CreateAccountInviteRequest) (*accountv1.CreateAccountInviteResponse, error)
CreateAccountInvite records the call and dispatches via CreateAccountInviteCalls.
func (*FakeAccountService) DeleteAccountInvite ¶ added in v0.20.0
func (f *FakeAccountService) DeleteAccountInvite(ctx context.Context, req *accountv1.DeleteAccountInviteRequest) (*accountv1.DeleteAccountInviteResponse, error)
DeleteAccountInvite records the call and dispatches via DeleteAccountInviteCalls.
func (*FakeAccountService) GetAccount ¶ added in v0.20.0
func (f *FakeAccountService) GetAccount(ctx context.Context, req *accountv1.GetAccountRequest) (*accountv1.GetAccountResponse, error)
GetAccount records the call and dispatches via GetAccountCalls.
func (*FakeAccountService) GetAccountInvite ¶ added in v0.20.0
func (f *FakeAccountService) GetAccountInvite(ctx context.Context, req *accountv1.GetAccountInviteRequest) (*accountv1.GetAccountInviteResponse, error)
GetAccountInvite records the call and dispatches via GetAccountInviteCalls.
func (*FakeAccountService) GetAccountMember ¶ added in v0.20.0
func (f *FakeAccountService) GetAccountMember(ctx context.Context, req *accountv1.GetAccountMemberRequest) (*accountv1.GetAccountMemberResponse, error)
GetAccountMember records the call and dispatches via GetAccountMemberCalls.
func (*FakeAccountService) ListAccountInvites ¶ added in v0.20.0
func (f *FakeAccountService) ListAccountInvites(ctx context.Context, req *accountv1.ListAccountInvitesRequest) (*accountv1.ListAccountInvitesResponse, error)
ListAccountInvites records the call and dispatches via ListAccountInvitesCalls.
func (*FakeAccountService) ListAccountMembers ¶ added in v0.20.0
func (f *FakeAccountService) ListAccountMembers(ctx context.Context, req *accountv1.ListAccountMembersRequest) (*accountv1.ListAccountMembersResponse, error)
ListAccountMembers records the call and dispatches via ListAccountMembersCalls.
func (*FakeAccountService) ListAccounts ¶ added in v0.20.0
func (f *FakeAccountService) ListAccounts(ctx context.Context, req *accountv1.ListAccountsRequest) (*accountv1.ListAccountsResponse, error)
ListAccounts records the call and dispatches via ListAccountsCalls.
func (*FakeAccountService) UpdateAccount ¶ added in v0.20.0
func (f *FakeAccountService) UpdateAccount(ctx context.Context, req *accountv1.UpdateAccountRequest) (*accountv1.UpdateAccountResponse, error)
UpdateAccount records the call and dispatches via UpdateAccountCalls.
type FakeAuthService ¶ added in v0.19.0
type FakeAuthService struct {
authv1.UnimplementedAuthServiceServer
ListManagementKeysCalls MethodSpy[*authv1.ListManagementKeysRequest, *authv1.ListManagementKeysResponse]
CreateManagementKeyCalls MethodSpy[*authv1.CreateManagementKeyRequest, *authv1.CreateManagementKeyResponse]
DeleteManagementKeyCalls MethodSpy[*authv1.DeleteManagementKeyRequest, *authv1.DeleteManagementKeyResponse]
}
FakeAuthService is a test fake that implements AuthServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeAuthService) CreateManagementKey ¶ added in v0.19.0
func (f *FakeAuthService) CreateManagementKey(ctx context.Context, req *authv1.CreateManagementKeyRequest) (*authv1.CreateManagementKeyResponse, error)
CreateManagementKey records the call and dispatches via CreateManagementKeyCalls.
func (*FakeAuthService) DeleteManagementKey ¶ added in v0.19.0
func (f *FakeAuthService) DeleteManagementKey(ctx context.Context, req *authv1.DeleteManagementKeyRequest) (*authv1.DeleteManagementKeyResponse, error)
DeleteManagementKey records the call and dispatches via DeleteManagementKeyCalls.
func (*FakeAuthService) ListManagementKeys ¶ added in v0.19.0
func (f *FakeAuthService) ListManagementKeys(ctx context.Context, req *authv1.ListManagementKeysRequest) (*authv1.ListManagementKeysResponse, error)
ListManagementKeys records the call and dispatches via ListManagementKeysCalls.
type FakeBackupService ¶ added in v0.2.0
type FakeBackupService struct {
backupv1.UnimplementedBackupServiceServer
ListBackupsCalls MethodSpy[*backupv1.ListBackupsRequest, *backupv1.ListBackupsResponse]
GetBackupCalls MethodSpy[*backupv1.GetBackupRequest, *backupv1.GetBackupResponse]
CreateBackupCalls MethodSpy[*backupv1.CreateBackupRequest, *backupv1.CreateBackupResponse]
DeleteBackupCalls MethodSpy[*backupv1.DeleteBackupRequest, *backupv1.DeleteBackupResponse]
ListBackupRestoresCalls MethodSpy[*backupv1.ListBackupRestoresRequest, *backupv1.ListBackupRestoresResponse]
RestoreBackupCalls MethodSpy[*backupv1.RestoreBackupRequest, *backupv1.RestoreBackupResponse]
ListBackupSchedulesCalls MethodSpy[*backupv1.ListBackupSchedulesRequest, *backupv1.ListBackupSchedulesResponse]
GetBackupScheduleCalls MethodSpy[*backupv1.GetBackupScheduleRequest, *backupv1.GetBackupScheduleResponse]
CreateBackupScheduleCalls MethodSpy[*backupv1.CreateBackupScheduleRequest, *backupv1.CreateBackupScheduleResponse]
UpdateBackupScheduleCalls MethodSpy[*backupv1.UpdateBackupScheduleRequest, *backupv1.UpdateBackupScheduleResponse]
DeleteBackupScheduleCalls MethodSpy[*backupv1.DeleteBackupScheduleRequest, *backupv1.DeleteBackupScheduleResponse]
}
FakeBackupService is a test fake that implements BackupServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeBackupService) CreateBackup ¶ added in v0.2.0
func (f *FakeBackupService) CreateBackup(ctx context.Context, req *backupv1.CreateBackupRequest) (*backupv1.CreateBackupResponse, error)
CreateBackup records the call and dispatches via CreateBackupCalls.
func (*FakeBackupService) CreateBackupSchedule ¶ added in v0.2.0
func (f *FakeBackupService) CreateBackupSchedule(ctx context.Context, req *backupv1.CreateBackupScheduleRequest) (*backupv1.CreateBackupScheduleResponse, error)
CreateBackupSchedule records the call and dispatches via CreateBackupScheduleCalls.
func (*FakeBackupService) DeleteBackup ¶ added in v0.2.0
func (f *FakeBackupService) DeleteBackup(ctx context.Context, req *backupv1.DeleteBackupRequest) (*backupv1.DeleteBackupResponse, error)
DeleteBackup records the call and dispatches via DeleteBackupCalls.
func (*FakeBackupService) DeleteBackupSchedule ¶ added in v0.2.0
func (f *FakeBackupService) DeleteBackupSchedule(ctx context.Context, req *backupv1.DeleteBackupScheduleRequest) (*backupv1.DeleteBackupScheduleResponse, error)
DeleteBackupSchedule records the call and dispatches via DeleteBackupScheduleCalls.
func (*FakeBackupService) GetBackup ¶ added in v0.2.0
func (f *FakeBackupService) GetBackup(ctx context.Context, req *backupv1.GetBackupRequest) (*backupv1.GetBackupResponse, error)
GetBackup records the call and dispatches via GetBackupCalls.
func (*FakeBackupService) GetBackupSchedule ¶ added in v0.2.0
func (f *FakeBackupService) GetBackupSchedule(ctx context.Context, req *backupv1.GetBackupScheduleRequest) (*backupv1.GetBackupScheduleResponse, error)
GetBackupSchedule records the call and dispatches via GetBackupScheduleCalls.
func (*FakeBackupService) ListBackupRestores ¶ added in v0.2.0
func (f *FakeBackupService) ListBackupRestores(ctx context.Context, req *backupv1.ListBackupRestoresRequest) (*backupv1.ListBackupRestoresResponse, error)
ListBackupRestores records the call and dispatches via ListBackupRestoresCalls.
func (*FakeBackupService) ListBackupSchedules ¶ added in v0.2.0
func (f *FakeBackupService) ListBackupSchedules(ctx context.Context, req *backupv1.ListBackupSchedulesRequest) (*backupv1.ListBackupSchedulesResponse, error)
ListBackupSchedules records the call and dispatches via ListBackupSchedulesCalls.
func (*FakeBackupService) ListBackups ¶ added in v0.2.0
func (f *FakeBackupService) ListBackups(ctx context.Context, req *backupv1.ListBackupsRequest) (*backupv1.ListBackupsResponse, error)
ListBackups records the call and dispatches via ListBackupsCalls.
func (*FakeBackupService) RestoreBackup ¶ added in v0.2.0
func (f *FakeBackupService) RestoreBackup(ctx context.Context, req *backupv1.RestoreBackupRequest) (*backupv1.RestoreBackupResponse, error)
RestoreBackup records the call and dispatches via RestoreBackupCalls.
func (*FakeBackupService) UpdateBackupSchedule ¶ added in v0.2.0
func (f *FakeBackupService) UpdateBackupSchedule(ctx context.Context, req *backupv1.UpdateBackupScheduleRequest) (*backupv1.UpdateBackupScheduleResponse, error)
UpdateBackupSchedule records the call and dispatches via UpdateBackupScheduleCalls.
type FakeBookingService ¶
type FakeBookingService struct {
bookingv1.UnimplementedBookingServiceServer
ListPackagesCalls MethodSpy[*bookingv1.ListPackagesRequest, *bookingv1.ListPackagesResponse]
GetPackageCalls MethodSpy[*bookingv1.GetPackageRequest, *bookingv1.GetPackageResponse]
}
FakeBookingService is a test fake that implements BookingServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeBookingService) GetPackage ¶ added in v0.4.1
func (f *FakeBookingService) GetPackage(ctx context.Context, req *bookingv1.GetPackageRequest) (*bookingv1.GetPackageResponse, error)
GetPackage records the call and dispatches via GetPackageCalls.
func (*FakeBookingService) ListPackages ¶
func (f *FakeBookingService) ListPackages(ctx context.Context, req *bookingv1.ListPackagesRequest) (*bookingv1.ListPackagesResponse, error)
ListPackages records the call and dispatches via ListPackagesCalls.
type FakeClusterService ¶
type FakeClusterService struct {
clusterv1.UnimplementedClusterServiceServer
ListClustersCalls MethodSpy[*clusterv1.ListClustersRequest, *clusterv1.ListClustersResponse]
GetClusterCalls MethodSpy[*clusterv1.GetClusterRequest, *clusterv1.GetClusterResponse]
CreateClusterCalls MethodSpy[*clusterv1.CreateClusterRequest, *clusterv1.CreateClusterResponse]
UpdateClusterCalls MethodSpy[*clusterv1.UpdateClusterRequest, *clusterv1.UpdateClusterResponse]
DeleteClusterCalls MethodSpy[*clusterv1.DeleteClusterRequest, *clusterv1.DeleteClusterResponse]
RestartClusterCalls MethodSpy[*clusterv1.RestartClusterRequest, *clusterv1.RestartClusterResponse]
SuspendClusterCalls MethodSpy[*clusterv1.SuspendClusterRequest, *clusterv1.SuspendClusterResponse]
UnsuspendClusterCalls MethodSpy[*clusterv1.UnsuspendClusterRequest, *clusterv1.UnsuspendClusterResponse]
SuggestClusterNameCalls MethodSpy[*clusterv1.SuggestClusterNameRequest, *clusterv1.SuggestClusterNameResponse]
ListQdrantReleasesCalls MethodSpy[*clusterv1.ListQdrantReleasesRequest, *clusterv1.ListQdrantReleasesResponse]
CreateClusterFromBackupCalls MethodSpy[*clusterv1.CreateClusterFromBackupRequest, *clusterv1.CreateClusterFromBackupResponse]
}
FakeClusterService is a test fake that implements ClusterServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeClusterService) CreateCluster ¶
func (f *FakeClusterService) CreateCluster(ctx context.Context, req *clusterv1.CreateClusterRequest) (*clusterv1.CreateClusterResponse, error)
CreateCluster records the call and dispatches via CreateClusterCalls.
func (*FakeClusterService) CreateClusterFromBackup ¶ added in v0.18.0
func (f *FakeClusterService) CreateClusterFromBackup(ctx context.Context, req *clusterv1.CreateClusterFromBackupRequest) (*clusterv1.CreateClusterFromBackupResponse, error)
CreateClusterFromBackup records the call and dispatches via CreateClusterFromBackupCalls.
func (*FakeClusterService) DeleteCluster ¶
func (f *FakeClusterService) DeleteCluster(ctx context.Context, req *clusterv1.DeleteClusterRequest) (*clusterv1.DeleteClusterResponse, error)
DeleteCluster records the call and dispatches via DeleteClusterCalls.
func (*FakeClusterService) GetCluster ¶
func (f *FakeClusterService) GetCluster(ctx context.Context, req *clusterv1.GetClusterRequest) (*clusterv1.GetClusterResponse, error)
GetCluster records the call and dispatches via GetClusterCalls.
func (*FakeClusterService) ListClusters ¶
func (f *FakeClusterService) ListClusters(ctx context.Context, req *clusterv1.ListClustersRequest) (*clusterv1.ListClustersResponse, error)
ListClusters records the call and dispatches via ListClustersCalls.
func (*FakeClusterService) ListQdrantReleases ¶
func (f *FakeClusterService) ListQdrantReleases(ctx context.Context, req *clusterv1.ListQdrantReleasesRequest) (*clusterv1.ListQdrantReleasesResponse, error)
ListQdrantReleases records the call and dispatches via ListQdrantReleasesCalls.
func (*FakeClusterService) RestartCluster ¶
func (f *FakeClusterService) RestartCluster(ctx context.Context, req *clusterv1.RestartClusterRequest) (*clusterv1.RestartClusterResponse, error)
RestartCluster records the call and dispatches via RestartClusterCalls.
func (*FakeClusterService) SuggestClusterName ¶
func (f *FakeClusterService) SuggestClusterName(ctx context.Context, req *clusterv1.SuggestClusterNameRequest) (*clusterv1.SuggestClusterNameResponse, error)
SuggestClusterName records the call and dispatches via SuggestClusterNameCalls.
func (*FakeClusterService) SuspendCluster ¶
func (f *FakeClusterService) SuspendCluster(ctx context.Context, req *clusterv1.SuspendClusterRequest) (*clusterv1.SuspendClusterResponse, error)
SuspendCluster records the call and dispatches via SuspendClusterCalls.
func (*FakeClusterService) UnsuspendCluster ¶
func (f *FakeClusterService) UnsuspendCluster(ctx context.Context, req *clusterv1.UnsuspendClusterRequest) (*clusterv1.UnsuspendClusterResponse, error)
UnsuspendCluster records the call and dispatches via UnsuspendClusterCalls.
func (*FakeClusterService) UpdateCluster ¶
func (f *FakeClusterService) UpdateCluster(ctx context.Context, req *clusterv1.UpdateClusterRequest) (*clusterv1.UpdateClusterResponse, error)
UpdateCluster records the call and dispatches via UpdateClusterCalls.
type FakeDatabaseApiKeyService ¶
type FakeDatabaseApiKeyService struct {
clusterauthv2.UnimplementedDatabaseApiKeyServiceServer
ListDatabaseApiKeysCalls MethodSpy[*clusterauthv2.ListDatabaseApiKeysRequest, *clusterauthv2.ListDatabaseApiKeysResponse]
CreateDatabaseApiKeyCalls MethodSpy[*clusterauthv2.CreateDatabaseApiKeyRequest, *clusterauthv2.CreateDatabaseApiKeyResponse]
DeleteDatabaseApiKeyCalls MethodSpy[*clusterauthv2.DeleteDatabaseApiKeyRequest, *clusterauthv2.DeleteDatabaseApiKeyResponse]
}
FakeDatabaseApiKeyService is a test fake that implements DatabaseApiKeyServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeDatabaseApiKeyService) CreateDatabaseApiKey ¶
func (f *FakeDatabaseApiKeyService) CreateDatabaseApiKey(ctx context.Context, req *clusterauthv2.CreateDatabaseApiKeyRequest) (*clusterauthv2.CreateDatabaseApiKeyResponse, error)
CreateDatabaseApiKey records the call and dispatches via CreateDatabaseApiKeyCalls.
func (*FakeDatabaseApiKeyService) DeleteDatabaseApiKey ¶
func (f *FakeDatabaseApiKeyService) DeleteDatabaseApiKey(ctx context.Context, req *clusterauthv2.DeleteDatabaseApiKeyRequest) (*clusterauthv2.DeleteDatabaseApiKeyResponse, error)
DeleteDatabaseApiKey records the call and dispatches via DeleteDatabaseApiKeyCalls.
func (*FakeDatabaseApiKeyService) ListDatabaseApiKeys ¶
func (f *FakeDatabaseApiKeyService) ListDatabaseApiKeys(ctx context.Context, req *clusterauthv2.ListDatabaseApiKeysRequest) (*clusterauthv2.ListDatabaseApiKeysResponse, error)
ListDatabaseApiKeys records the call and dispatches via ListDatabaseApiKeysCalls.
type FakeHybridService ¶ added in v0.15.0
type FakeHybridService struct {
hybridv1.UnimplementedHybridCloudServiceServer
ListHybridCloudEnvironmentsCalls MethodSpy[*hybridv1.ListHybridCloudEnvironmentsRequest, *hybridv1.ListHybridCloudEnvironmentsResponse]
GetHybridCloudEnvironmentCalls MethodSpy[*hybridv1.GetHybridCloudEnvironmentRequest, *hybridv1.GetHybridCloudEnvironmentResponse]
CreateHybridCloudEnvironmentCalls MethodSpy[*hybridv1.CreateHybridCloudEnvironmentRequest, *hybridv1.CreateHybridCloudEnvironmentResponse]
UpdateHybridCloudEnvironmentCalls MethodSpy[*hybridv1.UpdateHybridCloudEnvironmentRequest, *hybridv1.UpdateHybridCloudEnvironmentResponse]
DeleteHybridCloudEnvironmentCalls MethodSpy[*hybridv1.DeleteHybridCloudEnvironmentRequest, *hybridv1.DeleteHybridCloudEnvironmentResponse]
GenerateBootstrapCommandsCalls MethodSpy[*hybridv1.GenerateBootstrapCommandsRequest, *hybridv1.GenerateBootstrapCommandsResponse]
}
FakeHybridService is a test fake that implements HybridCloudServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeHybridService) CreateHybridCloudEnvironment ¶ added in v0.15.0
func (f *FakeHybridService) CreateHybridCloudEnvironment(ctx context.Context, req *hybridv1.CreateHybridCloudEnvironmentRequest) (*hybridv1.CreateHybridCloudEnvironmentResponse, error)
CreateHybridCloudEnvironment records the call and dispatches via CreateHybridCloudEnvironmentCalls.
func (*FakeHybridService) DeleteHybridCloudEnvironment ¶ added in v0.15.0
func (f *FakeHybridService) DeleteHybridCloudEnvironment(ctx context.Context, req *hybridv1.DeleteHybridCloudEnvironmentRequest) (*hybridv1.DeleteHybridCloudEnvironmentResponse, error)
DeleteHybridCloudEnvironment records the call and dispatches via DeleteHybridCloudEnvironmentCalls.
func (*FakeHybridService) GenerateBootstrapCommands ¶ added in v0.15.0
func (f *FakeHybridService) GenerateBootstrapCommands(ctx context.Context, req *hybridv1.GenerateBootstrapCommandsRequest) (*hybridv1.GenerateBootstrapCommandsResponse, error)
GenerateBootstrapCommands records the call and dispatches via GenerateBootstrapCommandsCalls.
func (*FakeHybridService) GetHybridCloudEnvironment ¶ added in v0.15.0
func (f *FakeHybridService) GetHybridCloudEnvironment(ctx context.Context, req *hybridv1.GetHybridCloudEnvironmentRequest) (*hybridv1.GetHybridCloudEnvironmentResponse, error)
GetHybridCloudEnvironment records the call and dispatches via GetHybridCloudEnvironmentCalls.
func (*FakeHybridService) ListHybridCloudEnvironments ¶ added in v0.15.0
func (f *FakeHybridService) ListHybridCloudEnvironments(ctx context.Context, req *hybridv1.ListHybridCloudEnvironmentsRequest) (*hybridv1.ListHybridCloudEnvironmentsResponse, error)
ListHybridCloudEnvironments records the call and dispatches via ListHybridCloudEnvironmentsCalls.
func (*FakeHybridService) UpdateHybridCloudEnvironment ¶ added in v0.15.0
func (f *FakeHybridService) UpdateHybridCloudEnvironment(ctx context.Context, req *hybridv1.UpdateHybridCloudEnvironmentRequest) (*hybridv1.UpdateHybridCloudEnvironmentResponse, error)
UpdateHybridCloudEnvironment records the call and dispatches via UpdateHybridCloudEnvironmentCalls.
type FakeIAMService ¶ added in v0.20.0
type FakeIAMService struct {
iamv1.UnimplementedIAMServiceServer
GetAuthenticatedUserCalls MethodSpy[*iamv1.GetAuthenticatedUserRequest, *iamv1.GetAuthenticatedUserResponse]
ListUsersCalls MethodSpy[*iamv1.ListUsersRequest, *iamv1.ListUsersResponse]
ListUserRolesCalls MethodSpy[*iamv1.ListUserRolesRequest, *iamv1.ListUserRolesResponse]
AssignUserRolesCalls MethodSpy[*iamv1.AssignUserRolesRequest, *iamv1.AssignUserRolesResponse]
ListRolesCalls MethodSpy[*iamv1.ListRolesRequest, *iamv1.ListRolesResponse]
GetRoleCalls MethodSpy[*iamv1.GetRoleRequest, *iamv1.GetRoleResponse]
CreateRoleCalls MethodSpy[*iamv1.CreateRoleRequest, *iamv1.CreateRoleResponse]
UpdateRoleCalls MethodSpy[*iamv1.UpdateRoleRequest, *iamv1.UpdateRoleResponse]
DeleteRoleCalls MethodSpy[*iamv1.DeleteRoleRequest, *iamv1.DeleteRoleResponse]
ListPermissionsCalls MethodSpy[*iamv1.ListPermissionsRequest, *iamv1.ListPermissionsResponse]
}
FakeIAMService is a test fake that implements IAMServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeIAMService) AssignUserRoles ¶ added in v0.20.0
func (f *FakeIAMService) AssignUserRoles(ctx context.Context, req *iamv1.AssignUserRolesRequest) (*iamv1.AssignUserRolesResponse, error)
AssignUserRoles records the call and dispatches via AssignUserRolesCalls.
func (*FakeIAMService) CreateRole ¶ added in v0.20.0
func (f *FakeIAMService) CreateRole(ctx context.Context, req *iamv1.CreateRoleRequest) (*iamv1.CreateRoleResponse, error)
CreateRole records the call and dispatches via CreateRoleCalls.
func (*FakeIAMService) DeleteRole ¶ added in v0.20.0
func (f *FakeIAMService) DeleteRole(ctx context.Context, req *iamv1.DeleteRoleRequest) (*iamv1.DeleteRoleResponse, error)
DeleteRole records the call and dispatches via DeleteRoleCalls.
func (*FakeIAMService) GetAuthenticatedUser ¶ added in v0.20.0
func (f *FakeIAMService) GetAuthenticatedUser(ctx context.Context, req *iamv1.GetAuthenticatedUserRequest) (*iamv1.GetAuthenticatedUserResponse, error)
GetAuthenticatedUser records the call and dispatches via GetAuthenticatedUserCalls.
func (*FakeIAMService) GetRole ¶ added in v0.20.0
func (f *FakeIAMService) GetRole(ctx context.Context, req *iamv1.GetRoleRequest) (*iamv1.GetRoleResponse, error)
GetRole records the call and dispatches via GetRoleCalls.
func (*FakeIAMService) ListPermissions ¶ added in v0.20.0
func (f *FakeIAMService) ListPermissions(ctx context.Context, req *iamv1.ListPermissionsRequest) (*iamv1.ListPermissionsResponse, error)
ListPermissions records the call and dispatches via ListPermissionsCalls.
func (*FakeIAMService) ListRoles ¶ added in v0.20.0
func (f *FakeIAMService) ListRoles(ctx context.Context, req *iamv1.ListRolesRequest) (*iamv1.ListRolesResponse, error)
ListRoles records the call and dispatches via ListRolesCalls.
func (*FakeIAMService) ListUserRoles ¶ added in v0.20.0
func (f *FakeIAMService) ListUserRoles(ctx context.Context, req *iamv1.ListUserRolesRequest) (*iamv1.ListUserRolesResponse, error)
ListUserRoles records the call and dispatches via ListUserRolesCalls.
func (*FakeIAMService) ListUsers ¶ added in v0.20.0
func (f *FakeIAMService) ListUsers(ctx context.Context, req *iamv1.ListUsersRequest) (*iamv1.ListUsersResponse, error)
ListUsers records the call and dispatches via ListUsersCalls.
func (*FakeIAMService) UpdateRole ¶ added in v0.20.0
func (f *FakeIAMService) UpdateRole(ctx context.Context, req *iamv1.UpdateRoleRequest) (*iamv1.UpdateRoleResponse, error)
UpdateRole records the call and dispatches via UpdateRoleCalls.
type FakeMonitoringService ¶ added in v0.17.0
type FakeMonitoringService struct {
monitoringv1.UnimplementedMonitoringServiceServer
GetClusterLogsCalls MethodSpy[*monitoringv1.GetClusterLogsRequest, *monitoringv1.GetClusterLogsResponse]
}
FakeMonitoringService is a test fake that implements MonitoringServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakeMonitoringService) GetClusterLogs ¶ added in v0.17.0
func (f *FakeMonitoringService) GetClusterLogs(ctx context.Context, req *monitoringv1.GetClusterLogsRequest) (*monitoringv1.GetClusterLogsResponse, error)
GetClusterLogs records the call and dispatches via GetClusterLogsCalls.
type FakePlatformService ¶
type FakePlatformService struct {
platformv1.UnimplementedPlatformServiceServer
ListCloudProvidersCalls MethodSpy[*platformv1.ListCloudProvidersRequest, *platformv1.ListCloudProvidersResponse]
ListCloudProviderRegionsCalls MethodSpy[*platformv1.ListCloudProviderRegionsRequest, *platformv1.ListCloudProviderRegionsResponse]
}
FakePlatformService is a test fake that implements PlatformServiceServer. Use the *Calls fields to configure responses and inspect captured requests.
func (*FakePlatformService) ListCloudProviderRegions ¶
func (f *FakePlatformService) ListCloudProviderRegions(ctx context.Context, req *platformv1.ListCloudProviderRegionsRequest) (*platformv1.ListCloudProviderRegionsResponse, error)
ListCloudProviderRegions records the call and dispatches via ListCloudProviderRegionsCalls.
func (*FakePlatformService) ListCloudProviders ¶
func (f *FakePlatformService) ListCloudProviders(ctx context.Context, req *platformv1.ListCloudProvidersRequest) (*platformv1.ListCloudProvidersResponse, error)
ListCloudProviders records the call and dispatches via ListCloudProvidersCalls.
type MethodSpy ¶ added in v0.3.0
type MethodSpy[Req, Resp any] struct { // contains filtered or unexported fields }
MethodSpy records calls to a single RPC method and optionally dispatches to per-call or fallback handlers. Use the *Calls fields on fake services instead of managing call counters and captured requests manually.
Priority when handling a call: *Func field > OnCall handler > Always handler > Unimplemented default.
func (*MethodSpy[Req, Resp]) All ¶ added in v0.3.0
func (m *MethodSpy[Req, Resp]) All() []Req
All returns a copy of all captured requests in call order.
func (*MethodSpy[Req, Resp]) Always ¶ added in v0.3.0
func (m *MethodSpy[Req, Resp]) Always(fn func(context.Context, Req) (Resp, error)) *MethodSpy[Req, Resp]
Always sets a fallback handler invoked for every call that has no matching OnCall entry. If neither OnCall nor Always is set the method falls back to the gRPC Unimplemented default.
func (*MethodSpy[Req, Resp]) Count ¶ added in v0.3.0
Count returns how many times the method has been called.
func (*MethodSpy[Req, Resp]) Last ¶ added in v0.3.0
Last returns the most recent request and true, or the zero value and false if never called.
func (*MethodSpy[Req, Resp]) OnCall ¶ added in v0.3.0
func (m *MethodSpy[Req, Resp]) OnCall(i int, fn func(context.Context, Req) (Resp, error)) *MethodSpy[Req, Resp]
OnCall registers a handler for the i-th call (0-indexed). Chainable.
type Option ¶
type Option func(*envConfig)
Option configures a TestEnv.
func WithAPIKey ¶
WithAPIKey sets the API key used by the test client's auth interceptor.
func WithAccountID ¶
WithAccountID sets the default account ID pre-configured on the test state.
func WithVersion ¶
WithVersion sets the CLI version used in the user-agent header.
type RequestCapture ¶
type RequestCapture struct {
// contains filtered or unexported fields
}
RequestCapture is a server-side unary interceptor that records incoming metadata.
func (*RequestCapture) Last ¶
func (rc *RequestCapture) Last() metadata.MD
Last returns the metadata from the most recent request.
type TestEnv ¶
type TestEnv struct {
State *state.State
Server *FakeClusterService
BookingServer *FakeBookingService
PlatformServer *FakePlatformService
DatabaseApiKeyServer *FakeDatabaseApiKeyService
BackupServer *FakeBackupService
HybridServer *FakeHybridService
MonitoringServer *FakeMonitoringService
AuthServer *FakeAuthService
IAMServer *FakeIAMService
AccountServer *FakeAccountService
Capture *RequestCapture
Cleanup func()
}
TestEnv bundles everything a test needs.
func NewBareTestEnv ¶
NewBareTestEnv creates a test environment with a bufconn-backed gRPC server but with no config values pre-populated in viper. Use this when the test itself controls how config is loaded — for example, to verify that account_id is read from a config file, an environment variable, or a CLI flag.
func NewTestEnv ¶
NewTestEnv creates a test environment with a bufconn-backed gRPC server and a pre-populated config. account_id and api_key are set via the highest viper priority (Set), so they reliably override any machine environment variables. Use this for testing command behaviour where a valid account ID is needed but its specific source doesn't matter. Defaults: account_id="test-account-id". Override with WithAccountID / WithAPIKey.