rule

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action bool
const (
	Allow Action = true
	Deny  Action = false
)

func (*Action) MarshalJSON

func (a *Action) MarshalJSON() ([]byte, error)

func (*Action) UnmarshalJSON

func (a *Action) UnmarshalJSON(data []byte) error

type Evaluator

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

Evaluator handles evaluating vanilla rule entries found in libraries and argument validation for installation and launch.

func NewEvaluator

func NewEvaluator(features ...string) *Evaluator

func (*Evaluator) Eval

func (e *Evaluator) Eval(rules []*Rule) (action Action)

type Rule

type Rule struct {
	Action Action `json:"action" mapstructure:"action"`
	OS     struct {
		Name    string `json:"name" mapstructure:"name"`
		Arch    string `json:"arch" mapstructure:"arch"`
		Version string `json:"version" mapstructure:"version"`
	}
	Features map[string]bool `json:"features" mapstructure:"features"`
}

Jump to

Keyboard shortcuts

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