Documentation
¶
Index ¶
- func Routes(h *Handler) chi.Router
- type Handler
- type ListPluginsResponse
- type Plugin
- type PluginResponse
- type PluginType
- type Repository
- func (r *Repository) Delete(ctx context.Context, teamID uuid.UUID, pluginType PluginType) error
- func (r *Repository) Get(ctx context.Context, teamID uuid.UUID, pluginType PluginType) (Plugin, map[string]string, error)
- func (r *Repository) GetResendConfig(ctx context.Context, teamID uuid.UUID) (alert.ResendEmailConfig, bool, error)
- func (r *Repository) GetZendutyConfig(ctx context.Context, teamID uuid.UUID) (alert.ZendutyConfig, bool, error)
- func (r *Repository) List(ctx context.Context, teamID uuid.UUID) ([]Plugin, error)
- func (r *Repository) Upsert(ctx context.Context, teamID uuid.UUID, pluginType PluginType, enabled bool, ...) (Plugin, error)
- type ResendConfig
- type Service
- func (s *Service) DeletePlugin(ctx context.Context, teamID uuid.UUID, pluginType PluginType) error
- func (s *Service) GetPlugin(ctx context.Context, teamID uuid.UUID, pluginType PluginType) (Plugin, map[string]string, error)
- func (s *Service) ListPlugins(ctx context.Context, teamID uuid.UUID) ([]Plugin, error)
- func (s *Service) UpsertPlugin(ctx context.Context, teamID uuid.UUID, pluginType PluginType, enabled bool, ...) (Plugin, error)
- type UpsertPluginRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) DeletePlugin ¶
func (h *Handler) DeletePlugin(w http.ResponseWriter, r *http.Request)
func (*Handler) ListPlugins ¶
func (h *Handler) ListPlugins(w http.ResponseWriter, r *http.Request)
func (*Handler) UpsertPlugin ¶
func (h *Handler) UpsertPlugin(w http.ResponseWriter, r *http.Request)
type ListPluginsResponse ¶
type ListPluginsResponse struct {
Plugins []PluginResponse `json:"plugins"`
}
type PluginResponse ¶
type PluginType ¶
type PluginType string
const ( PluginTypeResend PluginType = "resend" PluginTypeZenduty PluginType = "zenduty" )
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func (*Repository) Delete ¶
func (r *Repository) Delete(ctx context.Context, teamID uuid.UUID, pluginType PluginType) error
func (*Repository) Get ¶
func (r *Repository) Get(ctx context.Context, teamID uuid.UUID, pluginType PluginType) (Plugin, map[string]string, error)
func (*Repository) GetResendConfig ¶
func (r *Repository) GetResendConfig(ctx context.Context, teamID uuid.UUID) (alert.ResendEmailConfig, bool, error)
GetResendConfig is called by the alert service at send-time. It satisfies the alert.PluginConfigGetter interface.
func (*Repository) GetZendutyConfig ¶
func (r *Repository) GetZendutyConfig(ctx context.Context, teamID uuid.UUID) (alert.ZendutyConfig, bool, error)
GetZendutyConfig satisfies the alert.PluginConfigGetter interface.
type ResendConfig ¶
type ResendConfig struct {
APIKey string `json:"api_key"`
SenderEmail string `json:"sender_email"`
}
ResendConfig holds decrypted Resend credentials.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *Repository) *Service
func (*Service) DeletePlugin ¶
func (*Service) ListPlugins ¶
type UpsertPluginRequest ¶
Click to show internal directories.
Click to hide internal directories.