acl

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Wildcard = "*"

Wildcard is the ACL entity that matches every source address.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	Allow Action = 1
	Deny  Action = 2
)

func ParseAction

func ParseAction(actionStr string) (Action, error)

func (Action) IsAllow

func (a Action) IsAllow() bool

func (Action) IsDeny

func (a Action) IsDeny() bool

func (Action) IsEmpty

func (a Action) IsEmpty() bool

func (Action) IsValid

func (a Action) IsValid() bool

func (Action) MarshalJSON

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

func (Action) String

func (a Action) String() string

func (*Action) UnmarshalJSON

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

type Control

type Control struct {
	Action Action `json:"action"`
	Entity string `json:"entity"`
}

func ParseControl

func ParseControl(controlStr string) (*Control, error)

func (*Control) IsValid

func (c *Control) IsValid() bool

func (*Control) MarshalJSON

func (c *Control) MarshalJSON() ([]byte, error)

func (*Control) MarshalZerologObject

func (s *Control) MarshalZerologObject(e *zerolog.Event)

func (*Control) Matches

func (c *Control) Matches(entity string) bool

func (*Control) String

func (c *Control) String() string

func (*Control) UnmarshalJSON

func (c *Control) UnmarshalJSON(data []byte) error

type Network

type Network []*net.IPNet

func (Network) MarshalZerologArray

func (n Network) MarshalZerologArray(a *zerolog.Array)

func (Network) Matches

func (n Network) Matches(ip *net.IP) bool

func (Network) String

func (n Network) String() string

func (*Network) UnmarshalJSON

func (n *Network) UnmarshalJSON(data []byte) error

type Policy

type Policy []Control

func MustParsePolicy

func MustParsePolicy(polictStr string) Policy

func ParsePolicy

func ParsePolicy(policyStr string) (Policy, error)

func (Policy) Eval

func (p Policy) Eval(entity string) (Action, bool, error)

func (Policy) IsEmpty

func (p Policy) IsEmpty() bool

func (Policy) IsValid

func (p Policy) IsValid() bool

func (*Policy) MarshalJSON

func (p *Policy) MarshalJSON() ([]byte, error)

func (Policy) MarshalZerologArray

func (p Policy) MarshalZerologArray(a *zerolog.Array)

func (Policy) String

func (p Policy) String() string

func (*Policy) UnmarshalJSON

func (p *Policy) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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