Help us shape the future of Go! Take the 2026 Go Developer Survey

resourceGroup

package
v0.6.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceGroupDto

type ResourceGroupDto struct {
	Id               int                                                                     `json:"id,omitempty"`
	Name             string                                                                  `json:"name,omitempty" validate:"required,max=30,name-component"`
	Description      string                                                                  `json:"description,omitempty" validate:"max=50"`
	ResourceIds      []int                                                                   `json:"resourceIds"`
	Active           bool                                                                    `json:"active,omitempty"`
	ParentResourceId int                                                                     `json:"parentResourceId"`
	GroupType        ResourceGroupType                                                       `json:"groupType,omitempty"`
	UserId           int32                                                                   `json:"-"`
	EmailId          string                                                                  `json:"-"`
	CheckAuthBatch   func(emailId string, appObject []string, action string) map[string]bool `json:"-"`

	//for backward compatibility
	AppIds        []int `json:"appIds,omitempty"`
	EnvironmentId int   `json:"environmentId,omitempty"`
}

type ResourceGroupService

type ResourceGroupService interface {
	GetActiveResourceGroupList(emailId string, checkAuthBatch func(emailId string, appObject []string, action string) map[string]bool, envId int, groupType ResourceGroupType) ([]*ResourceGroupDto, error)
	//GetApplicationsForResourceGroup(appGroupId int) ([]*ApplicationDto, error)
	GetResourceIdsByResourceGroupId(resourceGroupId int) ([]int, error)
	CreateResourceGroup(request *ResourceGroupDto) (*ResourceGroupDto, error)
	UpdateResourceGroup(request *ResourceGroupDto) (*ResourceGroupDto, error)
	CheckResourceGroupPermissions(request *ResourceGroupDto) (bool, error)
	DeleteResourceGroup(resourceGroupId int, groupType ResourceGroupType, emailId string, checkAuthBatch func(emailId string, appObject []string, action string) map[string]bool) (bool, error)
}

type ResourceGroupServiceImpl

type ResourceGroupServiceImpl struct {
	// contains filtered or unexported fields
}

func NewResourceGroupServiceImpl

func NewResourceGroupServiceImpl(logger *zap.SugaredLogger, resourceGroupRepository resourceGroup.ResourceGroupRepository,
	resourceGroupMappingRepository resourceGroup.ResourceGroupMappingRepository, enforcerUtil rbac.EnforcerUtil,
	devtronResourceService devtronResource.DevtronResourceService,
) *ResourceGroupServiceImpl

func (*ResourceGroupServiceImpl) CheckResourceGroupPermissions

func (impl *ResourceGroupServiceImpl) CheckResourceGroupPermissions(request *ResourceGroupDto) (bool, error)

func (*ResourceGroupServiceImpl) CreateResourceGroup

func (impl *ResourceGroupServiceImpl) CreateResourceGroup(request *ResourceGroupDto) (*ResourceGroupDto, error)

func (*ResourceGroupServiceImpl) DeleteResourceGroup

func (impl *ResourceGroupServiceImpl) DeleteResourceGroup(resourceGroupId int, groupType ResourceGroupType, emailId string, checkAuthBatch func(emailId string, appObject []string, action string) map[string]bool) (bool, error)

func (*ResourceGroupServiceImpl) GetActiveResourceGroupList

func (impl *ResourceGroupServiceImpl) GetActiveResourceGroupList(emailId string, checkAuthBatch func(emailId string, appObject []string, action string) map[string]bool, parentResourceId int, groupType ResourceGroupType) ([]*ResourceGroupDto, error)

func (*ResourceGroupServiceImpl) GetResourceIdsByResourceGroupId

func (impl *ResourceGroupServiceImpl) GetResourceIdsByResourceGroupId(resourceGroupId int) ([]int, error)

func (*ResourceGroupServiceImpl) UpdateResourceGroup

func (impl *ResourceGroupServiceImpl) UpdateResourceGroup(request *ResourceGroupDto) (*ResourceGroupDto, error)

type ResourceGroupType

type ResourceGroupType string
const (
	APP_GROUP ResourceGroupType = "app-group"
	ENV_GROUP ResourceGroupType = "env-group"
)

type ResourceGroupingRequest

type ResourceGroupingRequest struct {
	ResourceGroupId   int
	ParentResourceId  int
	ResourceGroupType ResourceGroupType
	ResourceIds       []int                                                                                           `json:"appIds,omitempty"`
	EmailId           string                                                                                          `json:"emailId,omitempty"`
	CheckAuthBatch    func(emailId string, appObject []string, envObject []string) (map[string]bool, map[string]bool) `json:"-"`
	Ctx               context.Context                                                                                 `json:"-"`
	UserId            int32                                                                                           `json:"-"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL