Documentation ¶
Index ¶
- func SetupMockAccesscontrol(t *testing.T, ...) *accesscontrolmock.Mock
- func SetupUserServiceAccount(t *testing.T, sqlStore *sqlstore.SQLStore, testUser TestUser) *models.User
- type Calls
- type ServiceAccountMock
- func (s *ServiceAccountMock) CreateServiceAccount(ctx context.Context, orgID int64, name string) (*serviceaccounts.ServiceAccountDTO, error)
- func (s *ServiceAccountMock) DeleteServiceAccount(ctx context.Context, orgID, serviceAccountID int64) error
- func (s *ServiceAccountMock) Migrated(ctx context.Context, orgID int64) bool
- type ServiceAccountsStoreMock
- func (s *ServiceAccountsStoreMock) AddServiceAccountToken(ctx context.Context, serviceAccountID int64, ...) error
- func (s *ServiceAccountsStoreMock) ConvertToServiceAccounts(ctx context.Context, keys []int64) error
- func (s *ServiceAccountsStoreMock) CreateServiceAccount(ctx context.Context, orgID int64, name string) (*serviceaccounts.ServiceAccountDTO, error)
- func (s *ServiceAccountsStoreMock) DeleteServiceAccount(ctx context.Context, orgID, serviceAccountID int64) error
- func (s *ServiceAccountsStoreMock) DeleteServiceAccountToken(ctx context.Context, orgID, serviceAccountID, tokenID int64) error
- func (s *ServiceAccountsStoreMock) GetUsageMetrics(ctx context.Context) (map[string]interface{}, error)
- func (s *ServiceAccountsStoreMock) ListTokens(ctx context.Context, orgID int64, serviceAccount int64) ([]*models.ApiKey, error)
- func (s *ServiceAccountsStoreMock) RetrieveServiceAccount(ctx context.Context, orgID, serviceAccountID int64) (*serviceaccounts.ServiceAccountProfileDTO, error)
- func (s *ServiceAccountsStoreMock) SearchOrgServiceAccounts(ctx context.Context, orgID int64, query string, ...) (*serviceaccounts.SearchServiceAccountsResult, error)
- func (s *ServiceAccountsStoreMock) UpdateServiceAccount(ctx context.Context, orgID, serviceAccountID int64, ...) (*serviceaccounts.ServiceAccountProfileDTO, error)
- func (s *ServiceAccountsStoreMock) UpgradeServiceAccounts(ctx context.Context) error
- type TestUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupMockAccesscontrol ¶
func SetupMockAccesscontrol(t *testing.T, userpermissionsfunc func(c context.Context, siu *models.SignedInUser, opt accesscontrol.Options) ([]*accesscontrol.Permission, error), disableAccessControl bool) *accesscontrolmock.Mock
Types ¶
type Calls ¶
type Calls struct { CreateServiceAccount []interface{} RetrieveServiceAccount []interface{} DeleteServiceAccount []interface{} UpgradeServiceAccounts []interface{} ConvertServiceAccounts []interface{} ListTokens []interface{} DeleteServiceAccountToken []interface{} UpdateServiceAccount []interface{} AddServiceAccountToken []interface{} SearchOrgServiceAccounts []interface{} }
type ServiceAccountMock ¶
type ServiceAccountMock struct{}
create mock for serviceaccountservice
func (*ServiceAccountMock) CreateServiceAccount ¶
func (s *ServiceAccountMock) CreateServiceAccount(ctx context.Context, orgID int64, name string) (*serviceaccounts.ServiceAccountDTO, error)
func (*ServiceAccountMock) DeleteServiceAccount ¶
func (s *ServiceAccountMock) DeleteServiceAccount(ctx context.Context, orgID, serviceAccountID int64) error
type ServiceAccountsStoreMock ¶
type ServiceAccountsStoreMock struct {
Calls Calls
}
func (*ServiceAccountsStoreMock) AddServiceAccountToken ¶
func (s *ServiceAccountsStoreMock) AddServiceAccountToken(ctx context.Context, serviceAccountID int64, cmd *serviceaccounts.AddServiceAccountTokenCommand) error
func (*ServiceAccountsStoreMock) ConvertToServiceAccounts ¶
func (s *ServiceAccountsStoreMock) ConvertToServiceAccounts(ctx context.Context, keys []int64) error
func (*ServiceAccountsStoreMock) CreateServiceAccount ¶
func (s *ServiceAccountsStoreMock) CreateServiceAccount(ctx context.Context, orgID int64, name string) (*serviceaccounts.ServiceAccountDTO, error)
func (*ServiceAccountsStoreMock) DeleteServiceAccount ¶
func (s *ServiceAccountsStoreMock) DeleteServiceAccount(ctx context.Context, orgID, serviceAccountID int64) error
func (*ServiceAccountsStoreMock) DeleteServiceAccountToken ¶
func (s *ServiceAccountsStoreMock) DeleteServiceAccountToken(ctx context.Context, orgID, serviceAccountID, tokenID int64) error
func (*ServiceAccountsStoreMock) GetUsageMetrics ¶
func (s *ServiceAccountsStoreMock) GetUsageMetrics(ctx context.Context) (map[string]interface{}, error)
func (*ServiceAccountsStoreMock) ListTokens ¶
func (*ServiceAccountsStoreMock) RetrieveServiceAccount ¶
func (s *ServiceAccountsStoreMock) RetrieveServiceAccount(ctx context.Context, orgID, serviceAccountID int64) (*serviceaccounts.ServiceAccountProfileDTO, error)
func (*ServiceAccountsStoreMock) SearchOrgServiceAccounts ¶
func (s *ServiceAccountsStoreMock) SearchOrgServiceAccounts( ctx context.Context, orgID int64, query string, filter serviceaccounts.ServiceAccountFilter, page int, limit int, user *models.SignedInUser) (*serviceaccounts.SearchServiceAccountsResult, error)
func (*ServiceAccountsStoreMock) UpdateServiceAccount ¶
func (s *ServiceAccountsStoreMock) UpdateServiceAccount(ctx context.Context, orgID, serviceAccountID int64, saForm *serviceaccounts.UpdateServiceAccountForm) (*serviceaccounts.ServiceAccountProfileDTO, error)
func (*ServiceAccountsStoreMock) UpgradeServiceAccounts ¶
func (s *ServiceAccountsStoreMock) UpgradeServiceAccounts(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.