data

package
v0.0.0-...-07f90b3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Name       string        `yaml:"name" json:"name" xml:"name"`
	File       string        `yaml:"file" json:"file" xml:"file"`
	NumRecs    int64         `yaml:"numberOfRecords" json:"numberOfRecords" xml:"number-of-records"`
	Domains    []string      `yaml:"domains,omitempty" json:"domains,omitempty" xml:"domains,omitempty"`
	Forwarders []net.UDPAddr `yaml:"forwarders,omitempty" json:"forwarders,omitempty" xml:"forwarders,omitempty"`
}

type GroupBlock

type GroupBlock struct {
	Group Group
	Data  store.GroupStoreData
}

type GroupsBucket

type GroupsBucket struct {
	sync.Mutex

	Folder string           `yaml:"dataFolder" json:"dataFolder" xml:"data-folder"`
	Groups map[string]Group `yaml:"groups" json:"groups" xml:"groups"`
	// contains filtered or unexported fields
}

func NewGroupsBucket

func NewGroupsBucket(folder string, log log.Logger) GroupsBucket

func (*GroupsBucket) Contains

func (i *GroupsBucket) Contains(group string) bool

func (*GroupsBucket) ConvertToGroupLikeKey

func (i *GroupsBucket) ConvertToGroupLikeKey(key string) string

func (*GroupsBucket) CreateAndPersistGroupAndStore

func (i *GroupsBucket) CreateAndPersistGroupAndStore(key string, domains []string,
	forwarders []net.UDPAddr) (Group, store.GroupStoreData, error)

func (*GroupsBucket) CreateUnboundGroup

func (i *GroupsBucket) CreateUnboundGroup(key string, domains []string,
	forwarders []net.UDPAddr) Group

func (*GroupsBucket) Delete

func (i *GroupsBucket) Delete(groupName string) bool

func (*GroupsBucket) GetGroupById

func (i *GroupsBucket) GetGroupById(id string) (Group, error)

func (*GroupsBucket) GetGroupByName

func (i *GroupsBucket) GetGroupByName(name string) (Group, error)

func (*GroupsBucket) GetGroupStore

func (i *GroupsBucket) GetGroupStore(group Group) (store.GroupStoreData, error)

func (*GroupsBucket) GetGroupsByDomain

func (i *GroupsBucket) GetGroupsByDomain(domain string) ([]Group, error)

func (*GroupsBucket) Keys

func (i *GroupsBucket) Keys() []string

func (*GroupsBucket) ListGroups

func (i *GroupsBucket) ListGroups() []Group

func (*GroupsBucket) Load

func (i *GroupsBucket) Load(defaultForwarders []net.UDPAddr) error

func (*GroupsBucket) ReLoad

func (i *GroupsBucket) ReLoad() error

func (*GroupsBucket) SaveGroup

func (i *GroupsBucket) SaveGroup(groupStore store.GroupStoreData, group Group) (Group, error)

func (*GroupsBucket) SaveGroups

func (i *GroupsBucket) SaveGroups(groupsStore store.GroupsStoreData) error

func (*GroupsBucket) SaveMeta

func (i *GroupsBucket) SaveMeta() error

func (*GroupsBucket) UpdateExistingGroup

func (i *GroupsBucket) UpdateExistingGroup(group Group) bool

Jump to

Keyboard shortcuts

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