store

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c *domain.DBConfig) (*gorm.DB, error)

New returns the database instance

Types

type AlertRepository added in v0.4.0

type AlertRepository interface {
	Create(*domain.Alert) error
	Get(string, uint64, uint64, uint64) ([]domain.Alert, error)
	Migrate() error
}

type NamespaceRepository added in v0.4.0

type NamespaceRepository interface {
	Migrate() error
	List() ([]*domain.EncryptedNamespace, error)
	Create(*domain.EncryptedNamespace) error
	Get(uint64) (*domain.EncryptedNamespace, error)
	Update(*domain.EncryptedNamespace) error
	Delete(uint64) error
}

type ProviderRepository added in v0.4.0

type ProviderRepository interface {
	Migrate() error
	List(map[string]interface{}) ([]*domain.Provider, error)
	Create(*domain.Provider) (*domain.Provider, error)
	Get(uint64) (*domain.Provider, error)
	Update(*domain.Provider) (*domain.Provider, error)
	Delete(uint64) error
}

type ReceiverRepository added in v0.4.0

type ReceiverRepository interface {
	Migrate() error
	List() ([]*domain.Receiver, error)
	Create(*domain.Receiver) error
	Get(uint64) (*domain.Receiver, error)
	Update(*domain.Receiver) error
	Delete(uint64) error
}

type RepositoryContainer added in v0.4.0

type RepositoryContainer struct {
	ProviderRepository     ProviderRepository
	NamespaceRepository    NamespaceRepository
	TemplatesRepository    TemplatesRepository
	ReceiverRepository     ReceiverRepository
	SubscriptionRepository SubscriptionRepository
	AlertRepository        AlertRepository
	RuleRepository         RuleRepository
}

func NewRepositoryContainer added in v0.4.0

func NewRepositoryContainer(db *gorm.DB) *RepositoryContainer

type RuleRepository added in v0.4.0

type RuleRepository interface {
	Transactor
	Upsert(context.Context, *domain.Rule) error
	Get(context.Context, string, string, string, string, uint64) ([]domain.Rule, error)
	Migrate() error
}

type SubscriptionRepository added in v0.4.0

type SubscriptionRepository interface {
	Transactor
	Migrate() error
	List(context.Context) ([]*domain.Subscription, error)
	Create(context.Context, *domain.Subscription) error
	Get(context.Context, uint64) (*domain.Subscription, error)
	Update(context.Context, *domain.Subscription) error
	Delete(context.Context, uint64) error
}

type TemplatesRepository added in v0.4.0

type TemplatesRepository interface {
	Upsert(*domain.Template) error
	Index(string) ([]domain.Template, error)
	GetByName(string) (*domain.Template, error)
	Delete(string) error
	Render(string, map[string]string) (string, error)
	Migrate() error
}

type Transactor added in v0.4.0

type Transactor interface {
	WithTransaction(ctx context.Context) context.Context
	Rollback(ctx context.Context) error
	Commit(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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