Documentation ¶
Index ¶
- Constants
- Variables
- type Addr
- type CacheStorage
- func (s *CacheStorage) AddAddr(name string, ip string) error
- func (s *CacheStorage) AddRewrite(domain string, matchType string, addr string) error
- func (s *CacheStorage) DeleteAddr(name string) error
- func (s *CacheStorage) DeleteRewrite(domain string, matchType string) error
- func (s *CacheStorage) GetAddrs() []Addr
- func (s *CacheStorage) GetRewrites() EntrySet
- type Entry
- type EntrySet
- type MatchType
Constants ¶
View Source
const SelfAddrName = "self"
Variables ¶
View Source
var ErrInvalidIP = fmt.Errorf("invalid ip")
Functions ¶
This section is empty.
Types ¶
type CacheStorage ¶
type CacheStorage struct {
// contains filtered or unexported fields
}
CacheStorage stores and gives rewrites and addr mappings It should cache them between updates
func NewStorage ¶
func NewStorage(datastore datastore.Storage, selfAddr string) (*CacheStorage, error)
func (*CacheStorage) AddRewrite ¶
func (s *CacheStorage) AddRewrite(domain string, matchType string, addr string) error
func (*CacheStorage) DeleteAddr ¶
func (s *CacheStorage) DeleteAddr(name string) error
func (*CacheStorage) DeleteRewrite ¶
func (s *CacheStorage) DeleteRewrite(domain string, matchType string) error
func (*CacheStorage) GetAddrs ¶
func (s *CacheStorage) GetAddrs() []Addr
func (*CacheStorage) GetRewrites ¶
func (s *CacheStorage) GetRewrites() EntrySet
type EntrySet ¶
func (EntrySet) SortedByDomain ¶
Click to show internal directories.
Click to hide internal directories.