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

resourceGroup

package
v0.6.29 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 7

Documentation

Index

Constants

View Source
const (
	HibernatingApplicationsResourceGroupName   = "Hibernating Applications"
	UnhibernatingApplicationsResourceGroupName = "Unhibernating Applications"
)

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:"-"`
	CheckAuthBatch   func(token 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(token string, checkAuthBatch func(token 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, token string) (*ResourceGroupDto, error)
	UpdateResourceGroup(request *ResourceGroupDto, token string) (*ResourceGroupDto, error)
	CheckResourceGroupPermissions(request *ResourceGroupDto, token string) (bool, error)
	DeleteResourceGroup(resourceGroupId int, groupType ResourceGroupType, token string, checkAuthBatch func(token 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,
	devtronResourceSearchableKeyService devtronResource.DevtronResourceSearchableKeyService,
	appStatusRepository appStatusRepo.AppStatusRepository) *ResourceGroupServiceImpl

func (*ResourceGroupServiceImpl) CheckResourceGroupPermissions

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

func (*ResourceGroupServiceImpl) CreateResourceGroup

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

func (*ResourceGroupServiceImpl) DeleteResourceGroup

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

func (*ResourceGroupServiceImpl) GetActiveResourceGroupList

func (impl *ResourceGroupServiceImpl) GetActiveResourceGroupList(token string, checkAuthBatch func(token 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, token string) (*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"`
	CheckAuthBatch    func(token 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