policies

package
v0.6.60 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrPrepareForEvalCode = "11098"
	ErrEvalCode           = "11099"
)

Variables

This section is empty.

Functions

func ErrEval added in v0.6.54

func ErrEval(err error) error

func ErrPrepareForEval added in v0.6.54

func ErrPrepareForEval(err error) error

Types

type NetworkPolicyRegoResponse

type NetworkPolicyRegoResponse struct {
	ServicePodRelationships        []RelationObject `json:"service_pod_relationships,omitempty"`
	ServiceDeploymentRelationships []RelationObject `json:"service_deployment_relationships,omitempty"`
}

type Rego added in v0.6.54

type Rego struct {
	// contains filtered or unexported fields
}

func NewRegoInstance added in v0.6.54

func NewRegoInstance(policyDir string, relationshipDir string) (*Rego, error)

func (*Rego) RegoPolicyHandler added in v0.6.54

func (r *Rego) RegoPolicyHandler(regoQueryString string, designFile []byte) (map[string]interface{}, error)

RegoPolicyHandler takes the required inputs and run the query against all the policy files provided

type RegoPolicy

type RegoPolicy struct {
	Rules string `json:"rules"`
}

Define a simple policy struct

type RelationObject

type RelationObject struct {
	DestinationID   string                 `json:"destination_id,omitempty"`
	DestinationName string                 `json:"destination_name,omitempty"`
	SourceId        string                 `json:"source_id,omitempty"`
	SourceName      string                 `json:"source_name,omitempty"`
	Port            map[string]interface{} `json:"port,omitempty"`
}

Jump to

Keyboard shortcuts

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