api

package
v0.0.0-...-f328a8e Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubjectPrefix = "rules.engine"
	SetPolicy     = SubjectPrefix + ".policy.set"
	ListPolicies  = SubjectPrefix + ".policy.list"
	GetPolicy     = SubjectPrefix + ".policy.get"
	DeletePolicy  = SubjectPrefix + ".policy.delete"
)

Variables

View Source
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 InputAck

type InputAck struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

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) Descriptor() ([]byte, []int)

Deprecated: Use Policy.ProtoReflect.Descriptor instead.

func (*Policy) GetExpression

func (x *Policy) GetExpression() string

func (*Policy) GetId

func (x *Policy) GetId() string

func (*Policy) GetName

func (x *Policy) GetName() string

func (*Policy) GetRules

func (x *Policy) GetRules() []*Rule

func (*Policy) GetThresholds

func (x *Policy) GetThresholds() []*Threshold

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) ProtoReflect

func (x *Policy) ProtoReflect() protoreflect.Message

func (*Policy) Reset

func (x *Policy) Reset()

func (*Policy) String

func (x *Policy) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Rule.ProtoReflect.Descriptor instead.

func (*Rule) GetExpression

func (x *Rule) GetExpression() string

func (*Rule) GetName

func (x *Rule) GetName() string

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) ProtoReflect

func (x *Rule) ProtoReflect() protoreflect.Message

func (*Rule) Reset

func (x *Rule) Reset()

func (*Rule) String

func (x *Rule) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Threshold.ProtoReflect.Descriptor instead.

func (*Threshold) GetId

func (x *Threshold) GetId() string

func (*Threshold) GetValue

func (x *Threshold) GetValue() int64

func (*Threshold) ProtoMessage

func (*Threshold) ProtoMessage()

func (*Threshold) ProtoReflect

func (x *Threshold) ProtoReflect() protoreflect.Message

func (*Threshold) Reset

func (x *Threshold) Reset()

func (*Threshold) String

func (x *Threshold) String() string

Jump to

Keyboard shortcuts

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