notifier

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 15 Imported by: 6

Documentation

Index

Constants

View Source
const SES_CONFIG_TYPE = "ses"
View Source
const SLACK_CONFIG_TYPE = "slack"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppResponse

type AppResponse struct {
	Id   *int   `json:"id"`
	Name string `json:"name"`
}

type EnvResponse

type EnvResponse struct {
	Id   *int   `json:"id"`
	Name string `json:"name"`
}

type NSConfig

type NSConfig struct {
	TeamId       []*int            `json:"teamId"`
	AppId        []*int            `json:"appId"`
	EnvId        []*int            `json:"envId"`
	PipelineId   *int              `json:"pipelineId"`
	PipelineType util.PipelineType `json:"pipelineType" validate:"required"`
	EventTypeIds []int             `json:"eventTypeIds" validate:"required"`
	Providers    []*Provider       `json:"providers" validate:"required"`
}

type NSDeleteRequest

type NSDeleteRequest struct {
	Id []*int `json:"id"`
}

type NSViewResponse

type NSViewResponse struct {
	Total                        int                             `json:"total"`
	NotificationSettingsResponse []*NotificationSettingsResponse `json:"settings"`
}

type NotificationChannelAutoResponse

type NotificationChannelAutoResponse struct {
	ConfigName string `json:"configName"`
	Id         int    `json:"id"`
	TeamId     int    `json:"-"`
}

type NotificationConfigBuilder

type NotificationConfigBuilder interface {
	BuildNotificationSettingsConfig(notificationSettingsRequest *NotificationConfigRequest, existingNotificationSettingsConfig *repository.NotificationSettingsView, userId int32) (*repository.NotificationSettingsView, error)
	BuildNewNotificationSettings(notificationSettingsRequest *NotificationConfigRequest, notificationSettingsView *repository.NotificationSettingsView) ([]repository.NotificationSettings, error)
	BuildNotificationSettingWithPipeline(teamId *int, envId *int, appId *int, pipelineId *int, pipelineType util.PipelineType, eventTypeId int, viewId int, providers []*Provider) (repository.NotificationSettings, error)
}

type NotificationConfigBuilderImpl

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

func NewNotificationConfigBuilderImpl

func NewNotificationConfigBuilderImpl(logger *zap.SugaredLogger) *NotificationConfigBuilderImpl

func (NotificationConfigBuilderImpl) BuildNewNotificationSettings

func (impl NotificationConfigBuilderImpl) BuildNewNotificationSettings(notificationSettingsRequest *NotificationConfigRequest, notificationSettingsView *repository.NotificationSettingsView) ([]repository.NotificationSettings, error)

func (NotificationConfigBuilderImpl) BuildNotificationSettingWithPipeline

func (impl NotificationConfigBuilderImpl) BuildNotificationSettingWithPipeline(teamId *int, envId *int, appId *int, pipelineId *int, pipelineType util.PipelineType, eventTypeId int, viewId int, providers []*Provider) (repository.NotificationSettings, error)

func (NotificationConfigBuilderImpl) BuildNotificationSettingsConfig

func (impl NotificationConfigBuilderImpl) BuildNotificationSettingsConfig(notificationSettingsRequest *NotificationConfigRequest, existingNotificationSettingsConfig *repository.NotificationSettingsView, userId int32) (*repository.NotificationSettingsView, error)

type NotificationConfigRequest

type NotificationConfigRequest struct {
	Id           int               `json:"id"`
	TeamId       []*int            `json:"teamId"`
	AppId        []*int            `json:"appId"`
	EnvId        []*int            `json:"envId"`
	PipelineId   *int              `json:"pipelineId"`
	PipelineType util.PipelineType `json:"pipelineType" validate:"required"`
	EventTypeIds []int             `json:"eventTypeIds" validate:"required"`
	Providers    []*Provider       `json:"providers"`
}

type NotificationConfigService

type NotificationConfigService interface {
	CreateOrUpdateNotificationSettings(notificationSettingsRequest *NotificationRequest, userId int32) (int, error)
	FindAll(offset int, size int) ([]*repository.NotificationSettingsViewWithAppEnv, int, error)
	BuildNotificationSettingsResponse(notificationSettings []*repository.NotificationSettingsViewWithAppEnv) ([]*NotificationSettingsResponse, int, error)
	DeleteNotificationSettings(request NSDeleteRequest) error
	FindNotificationSettingOptions(request *repository.SearchRequest) ([]*SearchFilterResponse, error)

	UpdateNotificationSettings(notificationSettingsRequest *NotificationUpdateRequest, userId int32) (int, error)
	FetchNSViewByIds(ids []*int) ([]*NSConfig, error)
}

type NotificationConfigServiceImpl

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

func NewNotificationConfigServiceImpl

func NewNotificationConfigServiceImpl(logger *zap.SugaredLogger, notificationSettingsRepository repository.NotificationSettingsRepository, notificationConfigBuilder NotificationConfigBuilder, ciPipelineRepository pipelineConfig.CiPipelineRepository,
	pipelineRepository pipelineConfig.PipelineRepository, slackRepository repository.SlackNotificationRepository,
	sesRepository repository.SESNotificationRepository, teamRepository repository2.TeamRepository,
	environmentRepository repository3.EnvironmentRepository, appRepository app.AppRepository,
	userRepository repository4.UserRepository, ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository) *NotificationConfigServiceImpl

func (*NotificationConfigServiceImpl) BuildNotificationSettingsResponse

func (impl *NotificationConfigServiceImpl) BuildNotificationSettingsResponse(notificationSettingViews []*repository.NotificationSettingsViewWithAppEnv) ([]*NotificationSettingsResponse, int, error)

func (*NotificationConfigServiceImpl) CreateOrUpdateNotificationSettings

func (impl *NotificationConfigServiceImpl) CreateOrUpdateNotificationSettings(notificationSettingsRequest *NotificationRequest, userId int32) (int, error)

func (*NotificationConfigServiceImpl) DeleteNotificationSettings

func (impl *NotificationConfigServiceImpl) DeleteNotificationSettings(request NSDeleteRequest) error

func (*NotificationConfigServiceImpl) FetchNSViewByIds

func (impl *NotificationConfigServiceImpl) FetchNSViewByIds(ids []*int) ([]*NSConfig, error)

func (*NotificationConfigServiceImpl) FindAll

func (*NotificationConfigServiceImpl) FindNotificationSettingOptions

func (impl *NotificationConfigServiceImpl) FindNotificationSettingOptions(settingRequest *repository.SearchRequest) ([]*SearchFilterResponse, error)

func (*NotificationConfigServiceImpl) UpdateNotificationSettings

func (impl *NotificationConfigServiceImpl) UpdateNotificationSettings(notificationSettingsRequest *NotificationUpdateRequest, userId int32) (int, error)

type NotificationRecipientListingResponse

type NotificationRecipientListingResponse struct {
	Dest      util2.Channel `json:"dest"`
	ConfigId  int           `json:"configId"`
	Recipient string        `json:"recipient"`
}

type NotificationRequest

type NotificationRequest struct {
	UpdateType                util.UpdateType              `json:"updateType,omitempty"`
	SesConfigId               int                          `json:"sesConfigId,omitempty"`
	Providers                 []*Provider                  `json:"providers"`
	NotificationConfigRequest []*NotificationConfigRequest `json:"notificationConfigRequest" validate:"required"`
}

type NotificationSettingRequest

type NotificationSettingRequest struct {
	Id     int  `json:"id"`
	TeamId int  `json:"teamId"`
	AppId  *int `json:"appId"`
	EnvId  *int `json:"envId"`
	//Pipelines    []int             `json:"pipelineIds"`
	PipelineType util.PipelineType `json:"pipelineType" validate:"required"`
	EventTypeIds []int             `json:"eventTypeIds" validate:"required"`
	Providers    []Provider        `json:"providers" validate:"required"`
}

type NotificationSettingsResponse

type NotificationSettingsResponse struct {
	Id               int                `json:"id"`
	ConfigName       string             `json:"configName"`
	TeamResponse     []*TeamResponse    `json:"team"`
	AppResponse      []*AppResponse     `json:"app"`
	EnvResponse      []*EnvResponse     `json:"environment"`
	PipelineResponse *PipelineResponse  `json:"pipeline"`
	PipelineType     string             `json:"pipelineType"`
	ProvidersConfig  []*ProvidersConfig `json:"providerConfigs"`
	EventTypes       []int              `json:"eventTypes"`
}

type NotificationUpdateRequest

type NotificationUpdateRequest struct {
	UpdateType                util.UpdateType              `json:"updateType,omitempty"`
	NotificationConfigRequest []*NotificationConfigRequest `json:"notificationConfigRequest" validate:"required"`
}

type PipelineResponse

type PipelineResponse struct {
	Id              *int     `json:"id"`
	Name            string   `json:"name"`
	EnvironmentName string   `json:"environmentName,omitempty"`
	AppName         string   `json:"appName,omitempty"`
	Branches        []string `json:"branches,omitempty"`
}

type Provider

type Provider struct {
	Destination util.Channel `json:"dest"`
	Rule        string       `json:"rule"`
	ConfigId    int          `json:"configId"`
	Recipient   string       `json:"recipient"`
}

type Providers

type Providers struct {
	Providers []Provider `json:"providers"`
}

type ProvidersConfig

type ProvidersConfig struct {
	Id         int    `json:"id"`
	Dest       string `json:"dest"`
	ConfigName string `json:"name"`
	Recipient  string `json:"recipient"`
}

type SESChannelConfig

type SESChannelConfig struct {
	Channel       util2.Channel   `json:"channel" validate:"required"`
	SESConfigDtos []*SESConfigDto `json:"configs"`
}

type SESConfigDto

type SESConfigDto struct {
	OwnerId      int32  `json:"userId" validate:"number"`
	TeamId       int    `json:"teamId" validate:"number"`
	Region       string `json:"region" validate:"required"`
	AccessKey    string `json:"accessKey" validate:"required"`
	SecretKey    string `json:"secretKey" validate:"required"`
	FromEmail    string `json:"fromEmail" validate:"email,required"`
	ToEmail      string `json:"toEmail"`
	SessionToken string `json:"sessionToken"`
	ConfigName   string `json:"configName" validate:"required"`
	Description  string `json:"description"`
	Id           int    `json:"id" validate:"number"`
	Default      bool   `json:"default,notnull"`
}

type SESNotificationService

type SESNotificationService interface {
	SaveOrEditNotificationConfig(channelReq []*SESConfigDto, userId int32) ([]int, error)
	FetchSESNotificationConfigById(id int) (*SESConfigDto, error)
	FetchAllSESNotificationConfig() ([]*SESConfigDto, error)
	FetchAllSESNotificationConfigAutocomplete() ([]*NotificationChannelAutoResponse, error)
	DeleteNotificationConfig(channelReq *SESConfigDto, userId int32) error
}

type SESNotificationServiceImpl

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

func NewSESNotificationServiceImpl

func NewSESNotificationServiceImpl(logger *zap.SugaredLogger, sesRepository repository.SESNotificationRepository,
	teamService team.TeamService, notificationSettingsRepository repository.NotificationSettingsRepository) *SESNotificationServiceImpl

func (*SESNotificationServiceImpl) DeleteNotificationConfig added in v0.3.15

func (impl *SESNotificationServiceImpl) DeleteNotificationConfig(deleteReq *SESConfigDto, userId int32) error

func (*SESNotificationServiceImpl) FetchAllSESNotificationConfig

func (impl *SESNotificationServiceImpl) FetchAllSESNotificationConfig() ([]*SESConfigDto, error)

func (*SESNotificationServiceImpl) FetchAllSESNotificationConfigAutocomplete

func (impl *SESNotificationServiceImpl) FetchAllSESNotificationConfigAutocomplete() ([]*NotificationChannelAutoResponse, error)

func (*SESNotificationServiceImpl) FetchSESNotificationConfigById

func (impl *SESNotificationServiceImpl) FetchSESNotificationConfigById(id int) (*SESConfigDto, error)

func (*SESNotificationServiceImpl) SaveOrEditNotificationConfig

func (impl *SESNotificationServiceImpl) SaveOrEditNotificationConfig(channelReq []*SESConfigDto, userId int32) ([]int, error)

type SearchFilterResponse

type SearchFilterResponse struct {
	TeamResponse     []*TeamResponse   `json:"team"`
	AppResponse      []*AppResponse    `json:"app"`
	EnvResponse      []*EnvResponse    `json:"environment"`
	PipelineResponse *PipelineResponse `json:"pipeline"`
	PipelineType     string            `json:"pipelineType"`
}

type SlackChannelConfig

type SlackChannelConfig struct {
	Channel         util2.Channel    `json:"channel" validate:"required"`
	SlackConfigDtos []SlackConfigDto `json:"configs"`
}

type SlackConfigDto

type SlackConfigDto struct {
	OwnerId     int32  `json:"userId" validate:"number"`
	TeamId      int    `json:"teamId" validate:"required"`
	WebhookUrl  string `json:"webhookUrl" validate:"required"`
	ConfigName  string `json:"configName" validate:"required"`
	Description string `json:"description"`
	Id          int    `json:"id" validate:"number"`
}

type SlackNotificationService

type SlackNotificationService interface {
	SaveOrEditNotificationConfig(channelReq []SlackConfigDto, userId int32) ([]int, error)
	FetchSlackNotificationConfigById(id int) (*SlackConfigDto, error)
	FetchAllSlackNotificationConfig() ([]*SlackConfigDto, error)
	FetchAllSlackNotificationConfigAutocomplete() ([]*NotificationChannelAutoResponse, error)
	RecipientListingSuggestion(value string) ([]*NotificationRecipientListingResponse, error)
	DeleteNotificationConfig(deleteReq *SlackConfigDto, userId int32) error
}

type SlackNotificationServiceImpl

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

func NewSlackNotificationServiceImpl

func NewSlackNotificationServiceImpl(logger *zap.SugaredLogger, slackRepository repository.SlackNotificationRepository, teamService team.TeamService,
	userRepository repository2.UserRepository, notificationSettingsRepository repository.NotificationSettingsRepository) *SlackNotificationServiceImpl

func (*SlackNotificationServiceImpl) DeleteNotificationConfig added in v0.3.15

func (impl *SlackNotificationServiceImpl) DeleteNotificationConfig(deleteReq *SlackConfigDto, userId int32) error

func (*SlackNotificationServiceImpl) FetchAllSlackNotificationConfig

func (impl *SlackNotificationServiceImpl) FetchAllSlackNotificationConfig() ([]*SlackConfigDto, error)

func (*SlackNotificationServiceImpl) FetchAllSlackNotificationConfigAutocomplete

func (impl *SlackNotificationServiceImpl) FetchAllSlackNotificationConfigAutocomplete() ([]*NotificationChannelAutoResponse, error)

func (*SlackNotificationServiceImpl) FetchSlackNotificationConfigById

func (impl *SlackNotificationServiceImpl) FetchSlackNotificationConfigById(id int) (*SlackConfigDto, error)

func (*SlackNotificationServiceImpl) RecipientListingSuggestion

func (impl *SlackNotificationServiceImpl) RecipientListingSuggestion(value string) ([]*NotificationRecipientListingResponse, error)

func (*SlackNotificationServiceImpl) SaveOrEditNotificationConfig

func (impl *SlackNotificationServiceImpl) SaveOrEditNotificationConfig(channelReq []SlackConfigDto, userId int32) ([]int, error)

type TeamResponse

type TeamResponse struct {
	Id   *int   `json:"id"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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