Documentation
¶
Index ¶
Constants ¶
View Source
const (
OPTION_ACL = "acl"
)
Variables ¶
View Source
var (
ErrInvalidRule, ErrInvalidRuleFn = errors.NewErrorAndErrorFunc[string]("invalid rule")
ErrInvalidEntity, ErrInvalidEntityFn = errors.NewErrorAndErrorFunc[string]("invalid entity")
ErrNotPermitted = fmt.Errorf("not permitted")
)
View Source
var WithAcl, GetAcl = option.New[Acl](OPTION_ACL)
Functions ¶
This section is empty.
Types ¶
type Acl ¶
func FromString ¶
type Entity ¶
type Entity interface { ID() string Network() string Host() string Port() string Contains(Entity) bool String() string }
func Parse ¶
* <id>,<network>,<host>:<port> * examples: * "a,tcp,192.168.1.1:8080" => id=a, network=tcp, host=192.168.1.1, port=8080 * "a,tcp,*:8080" => id=a, network=tcp, host=*, port=8080 * "*,*,127.0.0.1:8080" => id=a, network=*, host=127.0.0.1 port=8080 * "a,tcp,*" => id=a, network=tcp, host=*, port=* * "a,*,*" => id=a, network=*, host=*, port=*
* "a,*" => id=a, network=*, host=*, port=* * "a,tcp" => id=a, network=tcp, host=*, port=*
* "a" => id=a, network=*, host=*, port=* * "*" => id=*, network=*, host=*, port=*
Click to show internal directories.
Click to hide internal directories.