Documentation
¶
Index ¶
- Constants
- Variables
- type DeletePolicyRequest
- func (*DeletePolicyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeletePolicyRequest) GetId() string
- func (*DeletePolicyRequest) ProtoMessage()
- func (x *DeletePolicyRequest) ProtoReflect() protoreflect.Message
- func (x *DeletePolicyRequest) Reset()
- func (x *DeletePolicyRequest) String() string
- type DeletePolicyResponse
- func (*DeletePolicyResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeletePolicyResponse) GetError() string
- func (x *DeletePolicyResponse) GetSuccess() bool
- func (*DeletePolicyResponse) ProtoMessage()
- func (x *DeletePolicyResponse) ProtoReflect() protoreflect.Message
- func (x *DeletePolicyResponse) Reset()
- func (x *DeletePolicyResponse) String() string
- type ErrorResponse
- type GetPolicyRequest
- type GetPolicyResponse
- type InputAck
- type ListPoliciesRequest
- type ListPoliciesResponse
- func (*ListPoliciesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListPoliciesResponse) GetPolicies() []*Policy
- func (*ListPoliciesResponse) ProtoMessage()
- func (x *ListPoliciesResponse) ProtoReflect() protoreflect.Message
- func (x *ListPoliciesResponse) Reset()
- func (x *ListPoliciesResponse) String() string
- type NatsHandler
- type Policy
- func (*Policy) Descriptor() ([]byte, []int)deprecated
- func (x *Policy) GetExpression() string
- func (x *Policy) GetId() string
- func (x *Policy) GetName() string
- func (x *Policy) GetRules() []*Rule
- func (x *Policy) GetThresholds() []*Threshold
- func (*Policy) ProtoMessage()
- func (x *Policy) ProtoReflect() protoreflect.Message
- func (x *Policy) Reset()
- func (x *Policy) String() string
- type PolicyResult
- func (*PolicyResult) Descriptor() ([]byte, []int)deprecated
- func (x *PolicyResult) GetError() string
- func (x *PolicyResult) GetPolicyId() string
- func (x *PolicyResult) GetResultThreshold() string
- func (x *PolicyResult) GetRuleResults() []*RuleResult
- func (*PolicyResult) ProtoMessage()
- func (x *PolicyResult) ProtoReflect() protoreflect.Message
- func (x *PolicyResult) Reset()
- func (x *PolicyResult) String() string
- type PolicyResults
- type Rule
- type RuleResult
- func (*RuleResult) Descriptor() ([]byte, []int)deprecated
- func (x *RuleResult) GetExecuted() bool
- func (x *RuleResult) GetScore() int64
- func (x *RuleResult) GetStop() bool
- func (*RuleResult) ProtoMessage()
- func (x *RuleResult) ProtoReflect() protoreflect.Message
- func (x *RuleResult) Reset()
- func (x *RuleResult) String() string
- type SetPolicyRequest
- type SetPolicyResponse
- func (*SetPolicyResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SetPolicyResponse) GetError() string
- func (x *SetPolicyResponse) GetSuccess() bool
- func (*SetPolicyResponse) ProtoMessage()
- func (x *SetPolicyResponse) ProtoReflect() protoreflect.Message
- func (x *SetPolicyResponse) Reset()
- func (x *SetPolicyResponse) String() string
- type Threshold
Constants ¶
const ( SubjectPrefix = "rules.engine" SetPolicy = SubjectPrefix + ".policy.set" ListPolicies = SubjectPrefix + ".policy.list" GetPolicy = SubjectPrefix + ".policy.get" DeletePolicy = SubjectPrefix + ".policy.delete" )
Variables ¶
var File_api_rules_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type DeletePolicyRequest ¶
type DeletePolicyRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*DeletePolicyRequest) Descriptor
deprecated
func (*DeletePolicyRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeletePolicyRequest.ProtoReflect.Descriptor instead.
func (*DeletePolicyRequest) GetId ¶
func (x *DeletePolicyRequest) GetId() string
func (*DeletePolicyRequest) ProtoMessage ¶
func (*DeletePolicyRequest) ProtoMessage()
func (*DeletePolicyRequest) ProtoReflect ¶
func (x *DeletePolicyRequest) ProtoReflect() protoreflect.Message
func (*DeletePolicyRequest) Reset ¶
func (x *DeletePolicyRequest) Reset()
func (*DeletePolicyRequest) String ¶
func (x *DeletePolicyRequest) String() string
type DeletePolicyResponse ¶
type DeletePolicyResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*DeletePolicyResponse) Descriptor
deprecated
func (*DeletePolicyResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeletePolicyResponse.ProtoReflect.Descriptor instead.
func (*DeletePolicyResponse) GetError ¶
func (x *DeletePolicyResponse) GetError() string
func (*DeletePolicyResponse) GetSuccess ¶
func (x *DeletePolicyResponse) GetSuccess() bool
func (*DeletePolicyResponse) ProtoMessage ¶
func (*DeletePolicyResponse) ProtoMessage()
func (*DeletePolicyResponse) ProtoReflect ¶
func (x *DeletePolicyResponse) ProtoReflect() protoreflect.Message
func (*DeletePolicyResponse) Reset ¶
func (x *DeletePolicyResponse) Reset()
func (*DeletePolicyResponse) String ¶
func (x *DeletePolicyResponse) String() string
type ErrorResponse ¶
type ErrorResponse struct {
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*ErrorResponse) Descriptor
deprecated
func (*ErrorResponse) Descriptor() ([]byte, []int)
Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.
func (*ErrorResponse) GetError ¶
func (x *ErrorResponse) GetError() string
func (*ErrorResponse) ProtoMessage ¶
func (*ErrorResponse) ProtoMessage()
func (*ErrorResponse) ProtoReflect ¶
func (x *ErrorResponse) ProtoReflect() protoreflect.Message
func (*ErrorResponse) Reset ¶
func (x *ErrorResponse) Reset()
func (*ErrorResponse) String ¶
func (x *ErrorResponse) String() string
type GetPolicyRequest ¶
type GetPolicyRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*GetPolicyRequest) Descriptor
deprecated
func (*GetPolicyRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPolicyRequest.ProtoReflect.Descriptor instead.
func (*GetPolicyRequest) GetId ¶
func (x *GetPolicyRequest) GetId() string
func (*GetPolicyRequest) ProtoMessage ¶
func (*GetPolicyRequest) ProtoMessage()
func (*GetPolicyRequest) ProtoReflect ¶
func (x *GetPolicyRequest) ProtoReflect() protoreflect.Message
func (*GetPolicyRequest) Reset ¶
func (x *GetPolicyRequest) Reset()
func (*GetPolicyRequest) String ¶
func (x *GetPolicyRequest) String() string
type GetPolicyResponse ¶
type GetPolicyResponse struct {
Policy *Policy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"`
// contains filtered or unexported fields
}
func (*GetPolicyResponse) Descriptor
deprecated
func (*GetPolicyResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPolicyResponse.ProtoReflect.Descriptor instead.
func (*GetPolicyResponse) GetPolicy ¶
func (x *GetPolicyResponse) GetPolicy() *Policy
func (*GetPolicyResponse) ProtoMessage ¶
func (*GetPolicyResponse) ProtoMessage()
func (*GetPolicyResponse) ProtoReflect ¶
func (x *GetPolicyResponse) ProtoReflect() protoreflect.Message
func (*GetPolicyResponse) Reset ¶
func (x *GetPolicyResponse) Reset()
func (*GetPolicyResponse) String ¶
func (x *GetPolicyResponse) String() string
type ListPoliciesRequest ¶
type ListPoliciesRequest struct {
// contains filtered or unexported fields
}
func (*ListPoliciesRequest) Descriptor
deprecated
func (*ListPoliciesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListPoliciesRequest.ProtoReflect.Descriptor instead.
func (*ListPoliciesRequest) ProtoMessage ¶
func (*ListPoliciesRequest) ProtoMessage()
func (*ListPoliciesRequest) ProtoReflect ¶
func (x *ListPoliciesRequest) ProtoReflect() protoreflect.Message
func (*ListPoliciesRequest) Reset ¶
func (x *ListPoliciesRequest) Reset()
func (*ListPoliciesRequest) String ¶
func (x *ListPoliciesRequest) String() string
type ListPoliciesResponse ¶
type ListPoliciesResponse struct {
Policies []*Policy `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"`
// contains filtered or unexported fields
}
func (*ListPoliciesResponse) Descriptor
deprecated
func (*ListPoliciesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListPoliciesResponse.ProtoReflect.Descriptor instead.
func (*ListPoliciesResponse) GetPolicies ¶
func (x *ListPoliciesResponse) GetPolicies() []*Policy
func (*ListPoliciesResponse) ProtoMessage ¶
func (*ListPoliciesResponse) ProtoMessage()
func (*ListPoliciesResponse) ProtoReflect ¶
func (x *ListPoliciesResponse) ProtoReflect() protoreflect.Message
func (*ListPoliciesResponse) Reset ¶
func (x *ListPoliciesResponse) Reset()
func (*ListPoliciesResponse) String ¶
func (x *ListPoliciesResponse) String() string
type NatsHandler ¶
type NatsHandler struct {
// contains filtered or unexported fields
}
func NewNatsHandler ¶
func NewNatsHandler(nc *nats.Conn, ruleEngine *engine.RuleEngine) (*NatsHandler, error)
func (*NatsHandler) HandleRequests ¶
func (h *NatsHandler) HandleRequests() error
type Policy ¶
type Policy struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Expression string `protobuf:"bytes,3,opt,name=expression,proto3" json:"expression,omitempty"`
Rules []*Rule `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty"`
Thresholds []*Threshold `protobuf:"bytes,5,rep,name=thresholds,proto3" json:"thresholds,omitempty"`
// contains filtered or unexported fields
}
func (*Policy) Descriptor
deprecated
func (*Policy) GetExpression ¶
func (*Policy) GetThresholds ¶
func (*Policy) ProtoMessage ¶
func (*Policy) ProtoMessage()
func (*Policy) ProtoReflect ¶
func (x *Policy) ProtoReflect() protoreflect.Message
type PolicyResult ¶
type PolicyResult struct {
PolicyId string `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
ResultThreshold string `protobuf:"bytes,2,opt,name=result_threshold,json=resultThreshold,proto3" json:"result_threshold,omitempty"`
Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
RuleResults []*RuleResult `protobuf:"bytes,4,rep,name=rule_results,json=ruleResults,proto3" json:"rule_results,omitempty"`
// contains filtered or unexported fields
}
func (*PolicyResult) Descriptor
deprecated
func (*PolicyResult) Descriptor() ([]byte, []int)
Deprecated: Use PolicyResult.ProtoReflect.Descriptor instead.
func (*PolicyResult) GetError ¶
func (x *PolicyResult) GetError() string
func (*PolicyResult) GetPolicyId ¶
func (x *PolicyResult) GetPolicyId() string
func (*PolicyResult) GetResultThreshold ¶
func (x *PolicyResult) GetResultThreshold() string
func (*PolicyResult) GetRuleResults ¶
func (x *PolicyResult) GetRuleResults() []*RuleResult
func (*PolicyResult) ProtoMessage ¶
func (*PolicyResult) ProtoMessage()
func (*PolicyResult) ProtoReflect ¶
func (x *PolicyResult) ProtoReflect() protoreflect.Message
func (*PolicyResult) Reset ¶
func (x *PolicyResult) Reset()
func (*PolicyResult) String ¶
func (x *PolicyResult) String() string
type PolicyResults ¶
type PolicyResults struct {
Results []*PolicyResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
// contains filtered or unexported fields
}
func (*PolicyResults) Descriptor
deprecated
func (*PolicyResults) Descriptor() ([]byte, []int)
Deprecated: Use PolicyResults.ProtoReflect.Descriptor instead.
func (*PolicyResults) GetResults ¶
func (x *PolicyResults) GetResults() []*PolicyResult
func (*PolicyResults) ProtoMessage ¶
func (*PolicyResults) ProtoMessage()
func (*PolicyResults) ProtoReflect ¶
func (x *PolicyResults) ProtoReflect() protoreflect.Message
func (*PolicyResults) Reset ¶
func (x *PolicyResults) Reset()
func (*PolicyResults) String ¶
func (x *PolicyResults) String() string
type Rule ¶
type Rule struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Expression string `protobuf:"bytes,2,opt,name=expression,proto3" json:"expression,omitempty"`
// contains filtered or unexported fields
}
func (*Rule) Descriptor
deprecated
func (*Rule) GetExpression ¶
func (*Rule) ProtoMessage ¶
func (*Rule) ProtoMessage()
func (*Rule) ProtoReflect ¶
func (x *Rule) ProtoReflect() protoreflect.Message
type RuleResult ¶
type RuleResult struct {
Score int64 `protobuf:"varint,1,opt,name=score,proto3" json:"score,omitempty"`
Stop bool `protobuf:"varint,2,opt,name=stop,proto3" json:"stop,omitempty"`
Executed bool `protobuf:"varint,3,opt,name=executed,proto3" json:"executed,omitempty"`
// contains filtered or unexported fields
}
func (*RuleResult) Descriptor
deprecated
func (*RuleResult) Descriptor() ([]byte, []int)
Deprecated: Use RuleResult.ProtoReflect.Descriptor instead.
func (*RuleResult) GetExecuted ¶
func (x *RuleResult) GetExecuted() bool
func (*RuleResult) GetScore ¶
func (x *RuleResult) GetScore() int64
func (*RuleResult) GetStop ¶
func (x *RuleResult) GetStop() bool
func (*RuleResult) ProtoMessage ¶
func (*RuleResult) ProtoMessage()
func (*RuleResult) ProtoReflect ¶
func (x *RuleResult) ProtoReflect() protoreflect.Message
func (*RuleResult) Reset ¶
func (x *RuleResult) Reset()
func (*RuleResult) String ¶
func (x *RuleResult) String() string
type SetPolicyRequest ¶
type SetPolicyRequest struct {
Policy *Policy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"`
// contains filtered or unexported fields
}
func (*SetPolicyRequest) Descriptor
deprecated
func (*SetPolicyRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetPolicyRequest.ProtoReflect.Descriptor instead.
func (*SetPolicyRequest) GetPolicy ¶
func (x *SetPolicyRequest) GetPolicy() *Policy
func (*SetPolicyRequest) ProtoMessage ¶
func (*SetPolicyRequest) ProtoMessage()
func (*SetPolicyRequest) ProtoReflect ¶
func (x *SetPolicyRequest) ProtoReflect() protoreflect.Message
func (*SetPolicyRequest) Reset ¶
func (x *SetPolicyRequest) Reset()
func (*SetPolicyRequest) String ¶
func (x *SetPolicyRequest) String() string
type SetPolicyResponse ¶
type SetPolicyResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
func (*SetPolicyResponse) Descriptor
deprecated
func (*SetPolicyResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetPolicyResponse.ProtoReflect.Descriptor instead.
func (*SetPolicyResponse) GetError ¶
func (x *SetPolicyResponse) GetError() string
func (*SetPolicyResponse) GetSuccess ¶
func (x *SetPolicyResponse) GetSuccess() bool
func (*SetPolicyResponse) ProtoMessage ¶
func (*SetPolicyResponse) ProtoMessage()
func (*SetPolicyResponse) ProtoReflect ¶
func (x *SetPolicyResponse) ProtoReflect() protoreflect.Message
func (*SetPolicyResponse) Reset ¶
func (x *SetPolicyResponse) Reset()
func (*SetPolicyResponse) String ¶
func (x *SetPolicyResponse) String() string
type Threshold ¶
type Threshold struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` // Cambiato da int32 a int64 per rappresentare un int in Go
// contains filtered or unexported fields
}
func (*Threshold) Descriptor
deprecated
func (*Threshold) ProtoMessage ¶
func (*Threshold) ProtoMessage()
func (*Threshold) ProtoReflect ¶
func (x *Threshold) ProtoReflect() protoreflect.Message