postgres

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(cfg db.Config) error

Types

type AlertRepository

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

AlertRepository talks to the store to read or insert data

func NewAlertRepository

func NewAlertRepository(client *pgc.Client) *AlertRepository

NewAlertRepository returns repository struct

func (AlertRepository) BulkUpdateSilence

func (r AlertRepository) BulkUpdateSilence(ctx context.Context, alertIDs []int64, silenceStatus string) error

func (AlertRepository) Create

func (r AlertRepository) Create(ctx context.Context, alrt alert.Alert) (alert.Alert, error)

func (AlertRepository) List

func (r AlertRepository) List(ctx context.Context, flt alert.Filter) ([]alert.Alert, error)

type IdempotencyRepository

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

IdempotencyRepository talks to the store to read or insert idempotency keys

func NewIdempotencyRepository

func NewIdempotencyRepository(client *pgc.Client) *IdempotencyRepository

NewIdempotencyRepository returns repository struct

func (*IdempotencyRepository) Check added in v0.7.0

func (*IdempotencyRepository) Create added in v0.7.0

func (r *IdempotencyRepository) Create(ctx context.Context, scope, key, notificationID string) (*notification.Idempotency, error)

func (*IdempotencyRepository) Delete

type LogRepository

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

LogRepository talks to the store to read or insert data

func NewLogRepository

func NewLogRepository(client *pgc.Client) *LogRepository

NewLogRepository returns LogRepository struct

func (*LogRepository) BulkCreate

func (r *LogRepository) BulkCreate(ctx context.Context, nss []log.Notification) error

func (*LogRepository) ListAlertIDsBySilenceID

func (r *LogRepository) ListAlertIDsBySilenceID(ctx context.Context, silenceID string) ([]int64, error)

func (*LogRepository) ListSubscriptionIDsBySilenceID

func (r *LogRepository) ListSubscriptionIDsBySilenceID(ctx context.Context, silenceID string) ([]int64, error)

type NamespaceRepository

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

NamespaceRepository talks to the store to read or insert data

func NewNamespaceRepository

func NewNamespaceRepository(client *pgc.Client) *NamespaceRepository

NewNamespaceRepository returns repository struct

func (*NamespaceRepository) Commit

func (r *NamespaceRepository) Commit(ctx context.Context) error

func (NamespaceRepository) Create

func (NamespaceRepository) Delete

func (r NamespaceRepository) Delete(ctx context.Context, id uint64) error

func (NamespaceRepository) Get

func (NamespaceRepository) List

func (*NamespaceRepository) Rollback

func (r *NamespaceRepository) Rollback(ctx context.Context, err error) error

func (NamespaceRepository) Update

func (NamespaceRepository) UpdateLabels added in v0.6.9

func (r NamespaceRepository) UpdateLabels(ctx context.Context, id uint64, labels map[string]string) error

func (*NamespaceRepository) WithTransaction

func (r *NamespaceRepository) WithTransaction(ctx context.Context) context.Context

type NotificationRepository

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

NotificationRepository talks to the store to read or insert data

func NewNotificationRepository

func NewNotificationRepository(client *pgc.Client) *NotificationRepository

NewNotificationRepository returns NotificationRepository struct

func (*NotificationRepository) Commit added in v0.7.0

func (*NotificationRepository) Create

func (*NotificationRepository) List added in v0.7.4

func (*NotificationRepository) Rollback added in v0.7.0

func (r *NotificationRepository) Rollback(ctx context.Context, err error) error

func (*NotificationRepository) WithTransaction added in v0.7.0

func (r *NotificationRepository) WithTransaction(ctx context.Context) context.Context

type ProviderRepository

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

ProviderRepository talks to the store to read or insert data

func NewProviderRepository

func NewProviderRepository(client *pgc.Client) *ProviderRepository

NewProviderRepository returns repository struct

func (ProviderRepository) Create

func (ProviderRepository) Delete

func (r ProviderRepository) Delete(ctx context.Context, id uint64) error

func (ProviderRepository) Get

func (ProviderRepository) List

func (ProviderRepository) Update

func (r ProviderRepository) Update(ctx context.Context, provDomain *provider.Provider) error

type ReceiverRepository

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

ReceiverRepository talks to the store to read or insert data

func NewReceiverRepository

func NewReceiverRepository(client *pgc.Client) *ReceiverRepository

NewReceiverRepository returns repository struct

func (ReceiverRepository) Create

func (ReceiverRepository) Delete

func (r ReceiverRepository) Delete(ctx context.Context, id uint64) error

func (ReceiverRepository) Get

func (ReceiverRepository) List

func (ReceiverRepository) PatchLabels added in v0.7.0

func (r ReceiverRepository) PatchLabels(ctx context.Context, rcv *receiver.Receiver) error

func (ReceiverRepository) Update

type RuleRepository

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

RuleRepository talks to the store to read or insert data

func NewRuleRepository

func NewRuleRepository(client *pgc.Client) *RuleRepository

NewRuleRepository returns repository struct

func (*RuleRepository) Commit

func (r *RuleRepository) Commit(ctx context.Context) error

func (*RuleRepository) List

func (r *RuleRepository) List(ctx context.Context, flt rule.Filter) ([]rule.Rule, error)

func (*RuleRepository) Rollback

func (r *RuleRepository) Rollback(ctx context.Context, err error) error

func (*RuleRepository) Upsert

func (r *RuleRepository) Upsert(ctx context.Context, rl *rule.Rule) error

func (*RuleRepository) WithTransaction

func (r *RuleRepository) WithTransaction(ctx context.Context) context.Context

type SilenceRepository

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

SilenceRepository talks to the store to read or insert data

func NewSilenceRepository

func NewSilenceRepository(client *pgc.Client) *SilenceRepository

NewSilenceRepository returns repository struct

func (*SilenceRepository) Create

func (*SilenceRepository) Get

func (*SilenceRepository) List

func (*SilenceRepository) SoftDelete

func (r *SilenceRepository) SoftDelete(ctx context.Context, id string) error

type SubscriptionRepository

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

SubscriptionRepository talks to the store to read or insert data

func NewSubscriptionRepository

func NewSubscriptionRepository(client *pgc.Client) *SubscriptionRepository

NewSubscriptionRepository returns SubscriptionRepository struct

func (*SubscriptionRepository) Create

func (*SubscriptionRepository) Delete

func (r *SubscriptionRepository) Delete(ctx context.Context, id uint64) error

func (*SubscriptionRepository) Get

func (*SubscriptionRepository) List

func (*SubscriptionRepository) Update

type TemplateRepository

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

TemplateRepository talks to the store to read or insert data

func NewTemplateRepository

func NewTemplateRepository(client *pgc.Client) *TemplateRepository

NewTemplateRepository returns repository struct

func (TemplateRepository) Delete

func (r TemplateRepository) Delete(ctx context.Context, name string) error

func (TemplateRepository) GetByName

func (r TemplateRepository) GetByName(ctx context.Context, name string) (*template.Template, error)

func (TemplateRepository) List

func (TemplateRepository) Upsert

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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