Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DndPrefix used throughout the domain restrictions to identify which are maintained by the program. DndDomainPrefix = "#dnd" // DndApplication prefix identify which resources were created by the program to restrict the appliations. DndApplicationPrefix = "com.dnd." )
Variables ¶
View Source
var ( // ErrPartialSync is returned when not all items could be checked // for a 100% synchronization. ErrPartialSync = errors.New("partially synchronized state") // ErrPartialCommit is returned when not all items could be commited // at the OS level, meaning not all items from the configuration // will take effect. ErrPartialCommit = errors.New("partially commited state") )
View Source
var TypeFromString = map[string]Type{ "Domain": Domain, "Application": Application, }
Functions ¶
func ConfigPath ¶
func ConfigPath() string
func CreateConfigDir ¶
func CreateConfigDir() error
func WriteConfig ¶
Types ¶
type Config ¶
type Config struct {
// LastCommited is the latest commited config
LastCommited *Config `json:"LastCommited,omitempty"`
// Version of the config
Version int64
// Currently stored restrictions.
Restrictions map[Type]List
}
func ReadConfig ¶
type List ¶
type List string
List is a comma separated list of values that describe addresses that must restricted
type RApplication ¶
type RApplication struct {
Pattern string
}
func NewApplication ¶
func NewApplication(item string) RApplication
func SyncApplications ¶
func SyncApplications() ([]RApplication, error)
type RDomain ¶
type RDomain struct {
Restrictions []struct {
IP string
Domains []string
Raw string
}
// contains filtered or unexported fields
}
RDomain is a domain restrictions that will block access to the specified domains, such as www.google.com etc.
func SyncDomains ¶
Click to show internal directories.
Click to hide internal directories.