Documentation ¶
Overview ¶
Package environment contains all functionalities related to Phobos environments.
Index ¶
- type CreateEnvironmentInput
- type CreateOrganizationEnvironmentRuleInput
- type CreateProjectEnvironmentRuleInput
- type DeleteEnvironmentInput
- type DeleteEnvironmentRuleInput
- type GetEnvironmentRulesInput
- type GetEnvironmentsInput
- type MockService
- func (_m *MockService) CreateEnvironment(ctx context.Context, input *CreateEnvironmentInput) (*models.Environment, error)
- func (_m *MockService) CreateOrganizationEnvironmentRule(ctx context.Context, input *CreateOrganizationEnvironmentRuleInput) (*models.EnvironmentRule, error)
- func (_m *MockService) CreateProjectEnvironmentRule(ctx context.Context, input *CreateProjectEnvironmentRuleInput) (*models.EnvironmentRule, error)
- func (_m *MockService) DeleteEnvironment(ctx context.Context, input *DeleteEnvironmentInput) error
- func (_m *MockService) DeleteEnvironmentRule(ctx context.Context, input *DeleteEnvironmentRuleInput) error
- func (_m *MockService) GetEnvironmentByID(ctx context.Context, id string) (*models.Environment, error)
- func (_m *MockService) GetEnvironmentByPRN(ctx context.Context, prn string) (*models.Environment, error)
- func (_m *MockService) GetEnvironmentRuleByID(ctx context.Context, id string) (*models.EnvironmentRule, error)
- func (_m *MockService) GetEnvironmentRuleByPRN(ctx context.Context, prn string) (*models.EnvironmentRule, error)
- func (_m *MockService) GetEnvironmentRules(ctx context.Context, input *GetEnvironmentRulesInput) (*db.EnvironmentRulesResult, error)
- func (_m *MockService) GetEnvironmentRulesByIDs(ctx context.Context, ids []string) ([]*models.EnvironmentRule, error)
- func (_m *MockService) GetEnvironments(ctx context.Context, input *GetEnvironmentsInput) (*db.EnvironmentsResult, error)
- func (_m *MockService) GetEnvironmentsByIDs(ctx context.Context, idList []string) ([]models.Environment, error)
- func (_m *MockService) UpdateEnvironment(ctx context.Context, input *UpdateEnvironmentInput) (*models.Environment, error)
- func (_m *MockService) UpdateEnvironmentRule(ctx context.Context, input *UpdateEnvironmentRuleInput) (*models.EnvironmentRule, error)
- type Service
- type UpdateEnvironmentInput
- type UpdateEnvironmentRuleInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateEnvironmentInput ¶
CreateEnvironmentInput is the input for creating a new environment
type CreateOrganizationEnvironmentRuleInput ¶
type CreateOrganizationEnvironmentRuleInput struct { OrganizationID string EnvironmentName string UserIDs []string TeamIDs []string ServiceAccountIDs []string RoleIDs []string }
CreateOrganizationEnvironmentRuleInput is the input for creating an environment protection rule
type CreateProjectEnvironmentRuleInput ¶
type CreateProjectEnvironmentRuleInput struct { ProjectID string EnvironmentName string UserIDs []string TeamIDs []string ServiceAccountIDs []string RoleIDs []string }
CreateProjectEnvironmentRuleInput is the input for creating an environment protection rule
type DeleteEnvironmentInput ¶
DeleteEnvironmentInput is the input for deleting an existing environment
type DeleteEnvironmentRuleInput ¶
DeleteEnvironmentRuleInput is the input for deleting an environment protection rule
type GetEnvironmentRulesInput ¶
type GetEnvironmentRulesInput struct { // Sort specifies the field to sort on and direction Sort *db.EnvironmentRuleSortableField // PaginationOptions supports cursor based pagination PaginationOptions *pagination.Options // OrganizationID filters the environment protection rules by the specified organization. OrganizationID *string // ProjectID filters the environment protection rules by the specified project. ProjectID *string // EnvironmentName filters the environment protection rules by the specified environment. EnvironmentName *string }
GetEnvironmentRulesInput is the input for querying a list of environment protection rules
type GetEnvironmentsInput ¶
type GetEnvironmentsInput struct { // Sort specifies the field to sort on and direction Sort *db.EnvironmentSortableField // PaginationOptions supports cursor based pagination PaginationOptions *pagination.Options // ProjectID is the project to return environments for ProjectID *string // OrganizationID is the organization to return environments for OrganizationID *string }
GetEnvironmentsInput is the input for querying a list of environments
type MockService ¶
MockService is an autogenerated mock type for the Service type
func NewMockService ¶
func NewMockService(t mockConstructorTestingTNewMockService) *MockService
NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockService) CreateEnvironment ¶
func (_m *MockService) CreateEnvironment(ctx context.Context, input *CreateEnvironmentInput) (*models.Environment, error)
CreateEnvironment provides a mock function with given fields: ctx, input
func (*MockService) CreateOrganizationEnvironmentRule ¶
func (_m *MockService) CreateOrganizationEnvironmentRule(ctx context.Context, input *CreateOrganizationEnvironmentRuleInput) (*models.EnvironmentRule, error)
CreateOrganizationEnvironmentRule provides a mock function with given fields: ctx, input
func (*MockService) CreateProjectEnvironmentRule ¶
func (_m *MockService) CreateProjectEnvironmentRule(ctx context.Context, input *CreateProjectEnvironmentRuleInput) (*models.EnvironmentRule, error)
CreateProjectEnvironmentRule provides a mock function with given fields: ctx, input
func (*MockService) DeleteEnvironment ¶
func (_m *MockService) DeleteEnvironment(ctx context.Context, input *DeleteEnvironmentInput) error
DeleteEnvironment provides a mock function with given fields: ctx, input
func (*MockService) DeleteEnvironmentRule ¶
func (_m *MockService) DeleteEnvironmentRule(ctx context.Context, input *DeleteEnvironmentRuleInput) error
DeleteEnvironmentRule provides a mock function with given fields: ctx, input
func (*MockService) GetEnvironmentByID ¶
func (_m *MockService) GetEnvironmentByID(ctx context.Context, id string) (*models.Environment, error)
GetEnvironmentByID provides a mock function with given fields: ctx, id
func (*MockService) GetEnvironmentByPRN ¶
func (_m *MockService) GetEnvironmentByPRN(ctx context.Context, prn string) (*models.Environment, error)
GetEnvironmentByPRN provides a mock function with given fields: ctx, prn
func (*MockService) GetEnvironmentRuleByID ¶
func (_m *MockService) GetEnvironmentRuleByID(ctx context.Context, id string) (*models.EnvironmentRule, error)
GetEnvironmentRuleByID provides a mock function with given fields: ctx, id
func (*MockService) GetEnvironmentRuleByPRN ¶
func (_m *MockService) GetEnvironmentRuleByPRN(ctx context.Context, prn string) (*models.EnvironmentRule, error)
GetEnvironmentRuleByPRN provides a mock function with given fields: ctx, prn
func (*MockService) GetEnvironmentRules ¶
func (_m *MockService) GetEnvironmentRules(ctx context.Context, input *GetEnvironmentRulesInput) (*db.EnvironmentRulesResult, error)
GetEnvironmentRules provides a mock function with given fields: ctx, input
func (*MockService) GetEnvironmentRulesByIDs ¶
func (_m *MockService) GetEnvironmentRulesByIDs(ctx context.Context, ids []string) ([]*models.EnvironmentRule, error)
GetEnvironmentRulesByIDs provides a mock function with given fields: ctx, ids
func (*MockService) GetEnvironments ¶
func (_m *MockService) GetEnvironments(ctx context.Context, input *GetEnvironmentsInput) (*db.EnvironmentsResult, error)
GetEnvironments provides a mock function with given fields: ctx, input
func (*MockService) GetEnvironmentsByIDs ¶
func (_m *MockService) GetEnvironmentsByIDs(ctx context.Context, idList []string) ([]models.Environment, error)
GetEnvironmentsByIDs provides a mock function with given fields: ctx, idList
func (*MockService) UpdateEnvironment ¶
func (_m *MockService) UpdateEnvironment(ctx context.Context, input *UpdateEnvironmentInput) (*models.Environment, error)
UpdateEnvironment provides a mock function with given fields: ctx, input
func (*MockService) UpdateEnvironmentRule ¶
func (_m *MockService) UpdateEnvironmentRule(ctx context.Context, input *UpdateEnvironmentRuleInput) (*models.EnvironmentRule, error)
UpdateEnvironmentRule provides a mock function with given fields: ctx, input
type Service ¶
type Service interface { GetEnvironmentByID(ctx context.Context, id string) (*models.Environment, error) GetEnvironmentByPRN(ctx context.Context, prn string) (*models.Environment, error) GetEnvironmentsByIDs(ctx context.Context, idList []string) ([]models.Environment, error) GetEnvironments(ctx context.Context, input *GetEnvironmentsInput) (*db.EnvironmentsResult, error) CreateEnvironment(ctx context.Context, input *CreateEnvironmentInput) (*models.Environment, error) UpdateEnvironment(ctx context.Context, input *UpdateEnvironmentInput) (*models.Environment, error) DeleteEnvironment(ctx context.Context, input *DeleteEnvironmentInput) error GetEnvironmentRuleByID(ctx context.Context, id string) (*models.EnvironmentRule, error) GetEnvironmentRuleByPRN(ctx context.Context, prn string) (*models.EnvironmentRule, error) GetEnvironmentRules(ctx context.Context, input *GetEnvironmentRulesInput) (*db.EnvironmentRulesResult, error) GetEnvironmentRulesByIDs(ctx context.Context, ids []string) ([]*models.EnvironmentRule, error) CreateOrganizationEnvironmentRule(ctx context.Context, input *CreateOrganizationEnvironmentRuleInput) (*models.EnvironmentRule, error) CreateProjectEnvironmentRule(ctx context.Context, input *CreateProjectEnvironmentRuleInput) (*models.EnvironmentRule, error) UpdateEnvironmentRule(ctx context.Context, input *UpdateEnvironmentRuleInput) (*models.EnvironmentRule, error) DeleteEnvironmentRule(ctx context.Context, input *DeleteEnvironmentRuleInput) error }
Service implements all environment related functionality
func NewService ¶
func NewService( logger logger.Logger, dbClient *db.Client, limitChecker limits.LimitChecker, activityService activityevent.Service, ) Service
NewService creates an instance of Service
type UpdateEnvironmentInput ¶
UpdateEnvironmentInput is the input for updating an existing environment