externalLink

package
v0.6.10-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADMIN_ROLE         string = "admin"
	SUPER_ADMIN_ROLE   string = "superAdmin"
	CLUSTER_LEVEL_LINK string = "clusterLevel"
	APP_LEVEL_LINK     string = "appLevel"
)

Variables

View Source
var TypeMappings = map[string]AppIdentifier{
	"app":                   APP,
	"cluster":               CLUSTER,
	"devtron-app":           DEVTRON_APP,
	"devtron-installed-app": DEVTRON_INSTALLED_APP,
	"external-helm-app":     EXTERNAL_HELM_APP,
}

Functions

This section is empty.

Types

type AppIdentifier added in v0.6.9

type AppIdentifier int
const (
	APP                   AppIdentifier = -1
	CLUSTER               AppIdentifier = 0
	DEVTRON_APP           AppIdentifier = 1
	DEVTRON_INSTALLED_APP AppIdentifier = 2
	EXTERNAL_HELM_APP     AppIdentifier = 3
)
type ExternalLink struct {
	Id                           int    `sql:"id,pk"`
	ExternalLinkMonitoringToolId int    `sql:"external_link_monitoring_tool_id, notnull"`
	Name                         string `sql:"name,notnull"`
	Url                          string `sql:"url,notnull"`
	IsEditable                   bool   `sql:"is_editable,notnull"`
	Description                  string `sql:"description"`
	Active                       bool   `sql:"active,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type ExternalLinkApiResponse

type ExternalLinkApiResponse struct {
	Success bool `json:"success"`
}

type ExternalLinkDto

type ExternalLinkDto struct {
	Id               int              `json:"id"`
	Name             string           `json:"name"`
	Url              string           `json:"url"`
	Active           bool             `json:"active"`
	MonitoringToolId int              `json:"monitoringToolId"`
	Type             string           `json:"type"`
	Identifiers      []LinkIdentifier `json:"identifiers"`
	IsEditable       bool             `json:"isEditable"`
	Description      string           `json:"description"`
	UpdatedOn        time.Time        `json:"updatedOn"`
	UserId           int32            `json:"-"`
}

type ExternalLinkIdentifierMapping added in v0.6.9

type ExternalLinkIdentifierMapping struct {
	Id             int           `sql:"id,pk"`
	ExternalLinkId int           `sql:"external_link_id,notnull"`
	Type           AppIdentifier `sql:"type,notnull"`
	Identifier     string        `sql:"identifier,notnull"`
	EnvId          int           `sql:"env_id,notnull"`
	AppId          int           `sql:"app_id,notnull"`
	ClusterId      int           `sql:"cluster_id,notnull"`
	Active         bool          `sql:"active, notnull"`
	//ExternalLink   ExternalLink
	sql.AuditLog
	// contains filtered or unexported fields
}

type ExternalLinkIdentifierMappingData added in v0.6.9

type ExternalLinkIdentifierMappingData struct {
	Id                           int           `sql:"id"`
	ExternalLinkMonitoringToolId int           `sql:"external_link_monitoring_tool_id, notnull"`
	Name                         string        `sql:"name,notnull"`
	Url                          string        `sql:"url,notnull"`
	IsEditable                   bool          `sql:"is_editable,notnull"`
	Description                  string        `sql:"description"`
	MappingId                    int           `sql:"mapping_id"`
	Active                       bool          `sql:"active"`
	Type                         AppIdentifier `sql:"type,notnull"`
	Identifier                   string        `sql:"identifier,notnull"`
	EnvId                        int           `sql:"env_id,notnull"`
	AppId                        int           `sql:"app_id,notnull"`
	ClusterId                    int           `sql:"cluster_id,notnull"`
	UpdatedOn                    time.Time     `sql:"updated_on"`
}

type ExternalLinkIdentifierMappingRepository added in v0.6.9

type ExternalLinkIdentifierMappingRepository interface {
	Save(externalLinksClusters *ExternalLinkIdentifierMapping, tx *pg.Tx) error

	FindAllActiveByLinkIdentifier(identifier *LinkIdentifier, clusterId int) ([]ExternalLinkIdentifierMappingData, error)

	Update(link *ExternalLinkIdentifierMapping, tx *pg.Tx) error
	UpdateAllActiveToInActive(Id int, tx *pg.Tx) error
	FindAllActiveByExternalLinkId(linkId int) ([]*ExternalLinkIdentifierMapping, error)

	FindAllActiveLinkIdentifierData() ([]ExternalLinkIdentifierMappingData, error)
}

type ExternalLinkIdentifierMappingRepositoryImpl added in v0.6.9

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

func NewExternalLinkIdentifierMappingRepositoryImpl added in v0.6.9

func NewExternalLinkIdentifierMappingRepositoryImpl(dbConnection *pg.DB) *ExternalLinkIdentifierMappingRepositoryImpl

func (ExternalLinkIdentifierMappingRepositoryImpl) FindAllActiveByExternalLinkId added in v0.6.9

func (impl ExternalLinkIdentifierMappingRepositoryImpl) FindAllActiveByExternalLinkId(linkId int) ([]*ExternalLinkIdentifierMapping, error)

func (ExternalLinkIdentifierMappingRepositoryImpl) FindAllActiveByLinkIdentifier added in v0.6.9

func (impl ExternalLinkIdentifierMappingRepositoryImpl) FindAllActiveByLinkIdentifier(linkIdentifier *LinkIdentifier, clusterId int) ([]ExternalLinkIdentifierMappingData, error)

func (ExternalLinkIdentifierMappingRepositoryImpl) FindAllActiveLinkIdentifierData added in v0.6.9

func (impl ExternalLinkIdentifierMappingRepositoryImpl) FindAllActiveLinkIdentifierData() ([]ExternalLinkIdentifierMappingData, error)

func (ExternalLinkIdentifierMappingRepositoryImpl) Save added in v0.6.9

func (ExternalLinkIdentifierMappingRepositoryImpl) Update added in v0.6.9

func (ExternalLinkIdentifierMappingRepositoryImpl) UpdateAllActiveToInActive added in v0.6.9

func (impl ExternalLinkIdentifierMappingRepositoryImpl) UpdateAllActiveToInActive(Id int, tx *pg.Tx) error

type ExternalLinkMonitoringTool

type ExternalLinkMonitoringTool struct {
	Id       int    `sql:"id,pk"`
	Name     string `sql:"name,notnull"`
	Icon     string `sql:"icon,notnull"`
	Category int    `sql:"category"`
	Active   bool   `sql:"active,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type ExternalLinkMonitoringToolDto

type ExternalLinkMonitoringToolDto struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	Icon     string `json:"icon"`
	Category int    `json:"category"`
}

type ExternalLinkMonitoringToolRepository

type ExternalLinkMonitoringToolRepository interface {
	FindAllActive() ([]ExternalLinkMonitoringTool, error)
}

type ExternalLinkMonitoringToolRepositoryImpl

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

func NewExternalLinkMonitoringToolRepositoryImpl

func NewExternalLinkMonitoringToolRepositoryImpl(dbConnection *pg.DB) *ExternalLinkMonitoringToolRepositoryImpl

func (ExternalLinkMonitoringToolRepositoryImpl) FindAllActive

type ExternalLinkRepository

type ExternalLinkRepository interface {
	Save(externalLinks *ExternalLink, tx *pg.Tx) error

	FindOne(id int) (ExternalLink, error)
	Update(link *ExternalLink, tx *pg.Tx) error

	GetConnection() *pg.DB
	FindAllClusterLinks() ([]ExternalLink, error)
}

type ExternalLinkRepositoryImpl

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

func NewExternalLinkRepositoryImpl

func NewExternalLinkRepositoryImpl(dbConnection *pg.DB) *ExternalLinkRepositoryImpl
func (impl ExternalLinkRepositoryImpl) FindAllClusterLinks() ([]ExternalLink, error)

func (ExternalLinkRepositoryImpl) FindOne

func (impl ExternalLinkRepositoryImpl) FindOne(id int) (ExternalLink, error)

func (ExternalLinkRepositoryImpl) GetConnection

func (repo ExternalLinkRepositoryImpl) GetConnection() *pg.DB

func (ExternalLinkRepositoryImpl) Save

func (impl ExternalLinkRepositoryImpl) Save(externalLinks *ExternalLink, tx *pg.Tx) error

func (ExternalLinkRepositoryImpl) Update

func (impl ExternalLinkRepositoryImpl) Update(link *ExternalLink, tx *pg.Tx) error

type ExternalLinkService

type ExternalLinkService interface {
	Create(requests []*ExternalLinkDto, userId int32, userRole string) (*ExternalLinkApiResponse, error)
	GetAllActiveTools() ([]ExternalLinkMonitoringToolDto, error)
	FetchAllActiveLinksByLinkIdentifier(linkIdentifier *LinkIdentifier, clusterId int) ([]*ExternalLinkDto, error)
	Update(request *ExternalLinkDto, userRole string) (*ExternalLinkApiResponse, error)
	DeleteLink(id int, userId int32, userRole string) (*ExternalLinkApiResponse, error)
}

type ExternalLinkServiceImpl

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

func NewExternalLinkServiceImpl

func NewExternalLinkServiceImpl(logger *zap.SugaredLogger, externalLinksToolsRepository ExternalLinkMonitoringToolRepository,
	externalLinkIdentifierMappingRepository ExternalLinkIdentifierMappingRepository, externalLinksRepository ExternalLinkRepository) *ExternalLinkServiceImpl

func (ExternalLinkServiceImpl) Create

func (impl ExternalLinkServiceImpl) Create(requests []*ExternalLinkDto, userId int32, userRole string) (*ExternalLinkApiResponse, error)
func (impl ExternalLinkServiceImpl) DeleteLink(id int, userId int32, userRole string) (*ExternalLinkApiResponse, error)

func (ExternalLinkServiceImpl) FetchAllActiveLinksByLinkIdentifier added in v0.6.9

func (impl ExternalLinkServiceImpl) FetchAllActiveLinksByLinkIdentifier(linkIdentifier *LinkIdentifier, clusterId int) ([]*ExternalLinkDto, error)

func (ExternalLinkServiceImpl) GetAllActiveTools

func (impl ExternalLinkServiceImpl) GetAllActiveTools() ([]ExternalLinkMonitoringToolDto, error)

func (ExternalLinkServiceImpl) Update

func (impl ExternalLinkServiceImpl) Update(request *ExternalLinkDto, userRole string) (*ExternalLinkApiResponse, error)

type LinkIdentifier added in v0.6.9

type LinkIdentifier struct {
	Type       string `json:"type"`
	Identifier string `json:"identifier"`
	EnvId      int    `json:"envId"`
	AppId      int    `json:"appId"`
	ClusterId  int    `json:"clusterId"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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