Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicate = errors.New("rule conflicted with existing") ErrRelation = errors.New("provider's namespace does not exist") )
Functions ¶
This section is empty.
Types ¶
type NamespaceService ¶
type Repository ¶
type Rule ¶
type Rule struct {
ID uint64 `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled" validate:"required"`
GroupName string `json:"group_name" validate:"required"`
Namespace string `json:"namespace" validate:"required"`
Template string `json:"template" validate:"required"`
Variables []RuleVariable `json:"variables" validate:"required,dive,required"`
ProviderNamespace uint64 `json:"provider_namespace" validate:"required"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type RuleFile ¶ added in v0.5.0
type RuleFile struct {
ApiVersion string `yaml:"apiVersion"`
Entity string `yaml:"entity"`
Type string `yaml:"type"`
Namespace string `yaml:"namespace"`
Provider string `yaml:"provider"`
ProviderNamespace string `yaml:"providerNamespace"`
Rules map[string]struct {
Template string `yaml:"template"`
Enabled bool `yaml:"enabled"`
Variables []variables `yaml:"variables"`
} `yaml:"rules"`
}
type RuleUploader ¶ added in v0.5.0
type RuleUploader interface {
UpsertRule(ctx context.Context, namespaceURN string, prov provider.Provider, rl *Rule, templateToUpdate *template.Template) error
}
RuleUploader is an interface for the provider to upload rule(s). Provider plugin needs to implement this interface in order to support rule synchronization from siren to provider
type RuleVariable ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
func NewService ¶
func NewService( repository Repository, templateService TemplateService, namespaceService NamespaceService, ruleUploadersRegistry map[string]RuleUploader, ) *Service
NewService returns repository struct
type TemplateService ¶
type Transactor ¶
Click to show internal directories.
Click to hide internal directories.