Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(db *gorm.DB) domain.RuleService
NewService returns repository struct
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository talks to the store to read or insert data
func NewRepository ¶
func NewRepository(db *gorm.DB) *Repository
NewRepository returns repository struct
func (Repository) Get ¶
func (r Repository) Get(name, namespace, groupName, template string, providerNamespace uint64) ([]Rule, error)
func (Repository) Migrate ¶
func (r Repository) Migrate() error
func (Repository) Upsert ¶
func (r Repository) Upsert(rule *Rule, templatesService domain.TemplatesService) (*Rule, error)
type Rule ¶
type Rule struct { Id uint64 `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time Name string `gorm:"index:idx_rule_name,unique"` Namespace string `gorm:"uniqueIndex:unique_name"` GroupName string `gorm:"uniqueIndex:unique_name"` Template string `gorm:"uniqueIndex:unique_name"` Enabled *bool Variables string `gorm:"type:jsonb" sql:"type:jsonb"` ProviderNamespace uint64 `gorm:"uniqueIndex:unique_name"` ProviderNamespaceInfo *namespace.Namespace `gorm:"foreignKey:ProviderNamespace"` }
type RuleRepository ¶
type RuleRepository interface { Upsert(*Rule, domain.TemplatesService) (*Rule, error) Get(string, string, string, string, uint64) ([]Rule, error) Migrate() error }
Repository interface
type RuleRepositoryMock ¶
RuleRepositoryMock is an autogenerated mock type for the RuleRepository type
func (*RuleRepositoryMock) Get ¶
func (_m *RuleRepositoryMock) Get(_a0 string, _a1 string, _a2 string, _a3 string, _a4 uint64) ([]Rule, error)
Get provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4
func (*RuleRepositoryMock) Migrate ¶
func (_m *RuleRepositoryMock) Migrate() error
Migrate provides a mock function with given fields:
func (*RuleRepositoryMock) Upsert ¶
func (_m *RuleRepositoryMock) Upsert(_a0 *Rule, _a1 domain.TemplatesService) (*Rule, error)
Upsert provides a mock function with given fields: _a0, _a1
type RuleResponse ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.