provisioning

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValidation = fmt.Errorf("invalid object specification")

Functions

func DeserializeAlertmanagerConfig

func DeserializeAlertmanagerConfig(config []byte) (*definitions.PostableUserConfig, error)

func NewFakeProvisioningStore

func NewFakeProvisioningStore() *fakeProvisioningStore

func SerializeAlertmanagerConfig

func SerializeAlertmanagerConfig(config definitions.PostableUserConfig) ([]byte, error)

Types

type AMConfigStore

type AMConfigStore interface {
	GetLatestAlertmanagerConfiguration(ctx context.Context, query *models.GetLatestAlertmanagerConfigurationQuery) error
	UpdateAlertmanagerConfiguration(ctx context.Context, cmd *models.SaveAlertmanagerConfigurationCmd) error
}

AMStore is a store of Alertmanager configurations.

type ContactPointService

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

func NewContactPointService

func NewContactPointService(store store.AlertingStore, encryptionService secrets.Service,
	provenanceStore ProvisioningStore, xact TransactionManager, log log.Logger) *ContactPointService

func (*ContactPointService) CreateContactPoint

func (ecp *ContactPointService) CreateContactPoint(ctx context.Context, orgID int64,
	contactPoint apimodels.EmbeddedContactPoint, provenance models.Provenance) (apimodels.EmbeddedContactPoint, error)

func (*ContactPointService) DeleteContactPoint

func (ecp *ContactPointService) DeleteContactPoint(ctx context.Context, orgID int64, uid string) error

func (*ContactPointService) GetContactPoints

func (ecp *ContactPointService) GetContactPoints(ctx context.Context, orgID int64) ([]apimodels.EmbeddedContactPoint, error)

func (*ContactPointService) UpdateContactPoint

func (ecp *ContactPointService) UpdateContactPoint(ctx context.Context, orgID int64, contactPoint apimodels.EmbeddedContactPoint, provenance models.Provenance) error

type MockAMConfigStore

type MockAMConfigStore struct {
	mock.Mock
}

MockAMConfigStore is an autogenerated mock type for the AMConfigStore type

func NewMockAMConfigStore

func NewMockAMConfigStore(t testing.TB) *MockAMConfigStore

NewMockAMConfigStore creates a new instance of MockAMConfigStore. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockAMConfigStore) EXPECT

func (*MockAMConfigStore) GetLatestAlertmanagerConfiguration

func (_m *MockAMConfigStore) GetLatestAlertmanagerConfiguration(ctx context.Context, query *models.GetLatestAlertmanagerConfigurationQuery) error

GetLatestAlertmanagerConfiguration provides a mock function with given fields: ctx, query

func (*MockAMConfigStore) UpdateAlertmanagerConfiguration

func (_m *MockAMConfigStore) UpdateAlertmanagerConfiguration(ctx context.Context, cmd *models.SaveAlertmanagerConfigurationCmd) error

UpdateAlertmanagerConfiguration provides a mock function with given fields: ctx, cmd

type MockAMConfigStore_Expecter

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

func (*MockAMConfigStore_Expecter) GetLatestAlertmanagerConfiguration

func (_e *MockAMConfigStore_Expecter) GetLatestAlertmanagerConfiguration(ctx interface{}, query interface{}) *MockAMConfigStore_GetLatestAlertmanagerConfiguration_Call

GetLatestAlertmanagerConfiguration is a helper method to define mock.On call

  • ctx context.Context
  • query *models.GetLatestAlertmanagerConfigurationQuery

func (*MockAMConfigStore_Expecter) UpdateAlertmanagerConfiguration

func (_e *MockAMConfigStore_Expecter) UpdateAlertmanagerConfiguration(ctx interface{}, cmd interface{}) *MockAMConfigStore_UpdateAlertmanagerConfiguration_Call

UpdateAlertmanagerConfiguration is a helper method to define mock.On call

  • ctx context.Context
  • cmd *models.SaveAlertmanagerConfigurationCmd

type MockAMConfigStore_GetLatestAlertmanagerConfiguration_Call

type MockAMConfigStore_GetLatestAlertmanagerConfiguration_Call struct {
	*mock.Call
}

MockAMConfigStore_GetLatestAlertmanagerConfiguration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestAlertmanagerConfiguration'

func (*MockAMConfigStore_GetLatestAlertmanagerConfiguration_Call) Return

type MockAMConfigStore_UpdateAlertmanagerConfiguration_Call

type MockAMConfigStore_UpdateAlertmanagerConfiguration_Call struct {
	*mock.Call
}

MockAMConfigStore_UpdateAlertmanagerConfiguration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAlertmanagerConfiguration'

func (*MockAMConfigStore_UpdateAlertmanagerConfiguration_Call) Return

type MockProvisioningStore

type MockProvisioningStore struct {
	mock.Mock
}

MockProvisioningStore is an autogenerated mock type for the ProvisioningStore type

func NewMockProvisioningStore

func NewMockProvisioningStore(t testing.TB) *MockProvisioningStore

NewMockProvisioningStore creates a new instance of MockProvisioningStore. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockProvisioningStore) DeleteProvenance

func (_m *MockProvisioningStore) DeleteProvenance(ctx context.Context, o models.Provisionable, org int64) error

DeleteProvenance provides a mock function with given fields: ctx, o, org

func (*MockProvisioningStore) EXPECT

func (*MockProvisioningStore) GetProvenance

GetProvenance provides a mock function with given fields: ctx, o, org

func (*MockProvisioningStore) GetProvenances

func (_m *MockProvisioningStore) GetProvenances(ctx context.Context, org int64, resourceType string) (map[string]models.Provenance, error)

GetProvenances provides a mock function with given fields: ctx, org, resourceType

func (*MockProvisioningStore) SetProvenance

SetProvenance provides a mock function with given fields: ctx, o, org, p

type MockProvisioningStore_DeleteProvenance_Call

type MockProvisioningStore_DeleteProvenance_Call struct {
	*mock.Call
}

MockProvisioningStore_DeleteProvenance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProvenance'

func (*MockProvisioningStore_DeleteProvenance_Call) Return

func (*MockProvisioningStore_DeleteProvenance_Call) Run

type MockProvisioningStore_Expecter

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

func (*MockProvisioningStore_Expecter) DeleteProvenance

func (_e *MockProvisioningStore_Expecter) DeleteProvenance(ctx interface{}, o interface{}, org interface{}) *MockProvisioningStore_DeleteProvenance_Call

DeleteProvenance is a helper method to define mock.On call

  • ctx context.Context
  • o models.Provisionable
  • org int64

func (*MockProvisioningStore_Expecter) GetProvenance

func (_e *MockProvisioningStore_Expecter) GetProvenance(ctx interface{}, o interface{}, org interface{}) *MockProvisioningStore_GetProvenance_Call

GetProvenance is a helper method to define mock.On call

  • ctx context.Context
  • o models.Provisionable
  • org int64

func (*MockProvisioningStore_Expecter) GetProvenances

func (_e *MockProvisioningStore_Expecter) GetProvenances(ctx interface{}, org interface{}, resourceType interface{}) *MockProvisioningStore_GetProvenances_Call

GetProvenances is a helper method to define mock.On call

  • ctx context.Context
  • org int64
  • resourceType string

func (*MockProvisioningStore_Expecter) SetProvenance

func (_e *MockProvisioningStore_Expecter) SetProvenance(ctx interface{}, o interface{}, org interface{}, p interface{}) *MockProvisioningStore_SetProvenance_Call

SetProvenance is a helper method to define mock.On call

  • ctx context.Context
  • o models.Provisionable
  • org int64
  • p models.Provenance

type MockProvisioningStore_GetProvenance_Call

type MockProvisioningStore_GetProvenance_Call struct {
	*mock.Call
}

MockProvisioningStore_GetProvenance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProvenance'

func (*MockProvisioningStore_GetProvenance_Call) Return

func (*MockProvisioningStore_GetProvenance_Call) Run

type MockProvisioningStore_GetProvenances_Call

type MockProvisioningStore_GetProvenances_Call struct {
	*mock.Call
}

MockProvisioningStore_GetProvenances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProvenances'

func (*MockProvisioningStore_GetProvenances_Call) Return

func (*MockProvisioningStore_GetProvenances_Call) Run

type MockProvisioningStore_SetProvenance_Call

type MockProvisioningStore_SetProvenance_Call struct {
	*mock.Call
}

MockProvisioningStore_SetProvenance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetProvenance'

func (*MockProvisioningStore_SetProvenance_Call) Return

func (*MockProvisioningStore_SetProvenance_Call) Run

type MuteTimingService

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

func NewMuteTimingService

func NewMuteTimingService(config AMConfigStore, prov ProvisioningStore, xact TransactionManager, log log.Logger) *MuteTimingService

func (*MuteTimingService) GetMuteTimings

func (m *MuteTimingService) GetMuteTimings(ctx context.Context, orgID int64) ([]definitions.MuteTiming, error)

type NotificationPolicyService

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

func (*NotificationPolicyService) GetAMConfigStore

func (nps *NotificationPolicyService) GetAMConfigStore() AMConfigStore

func (*NotificationPolicyService) GetPolicyTree

func (nps *NotificationPolicyService) GetPolicyTree(ctx context.Context, orgID int64) (definitions.Route, error)

func (*NotificationPolicyService) UpdatePolicyTree

func (nps *NotificationPolicyService) UpdatePolicyTree(ctx context.Context, orgID int64, tree definitions.Route, p models.Provenance) error

type ProvisioningStore

type ProvisioningStore interface {
	GetProvenance(ctx context.Context, o models.Provisionable, org int64) (models.Provenance, error)
	GetProvenances(ctx context.Context, org int64, resourceType string) (map[string]models.Provenance, error)
	SetProvenance(ctx context.Context, o models.Provisionable, org int64, p models.Provenance) error
	DeleteProvenance(ctx context.Context, o models.Provisionable, org int64) error
}

ProvisioningStore is a store of provisioning data for arbitrary objects.

type TemplateService

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

func NewTemplateService

func NewTemplateService(config AMConfigStore, prov ProvisioningStore, xact TransactionManager, log log.Logger) *TemplateService

func (*TemplateService) DeleteTemplate

func (t *TemplateService) DeleteTemplate(ctx context.Context, orgID int64, name string) error

func (*TemplateService) GetTemplates

func (t *TemplateService) GetTemplates(ctx context.Context, orgID int64) (map[string]string, error)

func (*TemplateService) SetTemplate

type TransactionManager

type TransactionManager interface {
	InTransaction(ctx context.Context, work func(ctx context.Context) error) error
}

TransactionManager represents the ability to issue and close transactions through contexts.

Jump to

Keyboard shortcuts

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