Skip to content

r-usenko/allow-deny-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy check exists value in allowed and denied lists

package main

import (
	"fmt"

	access "github.com/r-usenko/allow-deny-list"
)

func main() {

	if err := access.Allowed("A", "B").IsAllowed("C"); err != nil {
		fmt.Println("Scenario #1:", err)
	}

	if err := access.Allowed("A", "B", "C").IsAllowed("A"); err != nil {
		fmt.Println("Scenario #2:", err)
	}

	if err := access.Denied(1, 2).IsAllowed(3); err != nil {
		fmt.Println("Scenario #3:", err)
	}

	if err := access.Denied(int64(1), int64(2), int64(3)).IsAllowed(int64(1)); err != nil {
		fmt.Println("Scenario #4:", err)
	}
}

About

allow/deny checker

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages