plugin

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

source: https://github.com/shawn1m/overture/blob/master/core/cache/cache.go Copyright (c) 2014 The SkyDNS Authors. All rights reserved. Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.

Index

Constants

View Source
const (
	IN   = 0x01
	OUT  = 0x02
	BOTH = 0x03
)

Variables

View Source
var Plugins map[string]Plugin

Functions

func Register

func Register(p Plugin)

Types

type Area added in v0.2.0

type Area struct {
	Domains  *domain.Tree
	Upstream *common.DNSUpstream
}

type Cache

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Cache) Capacity

func (c *Cache) Capacity() int

func (*Cache) EvictRandom

func (c *Cache) EvictRandom()

func (*Cache) HandleDns

func (c *Cache) HandleDns(ctx *common.Context)

func (*Cache) Hit

func (c *Cache) Hit(q dns.Question, msgid uint16) *dns.Msg

func (*Cache) Init

func (c *Cache) Init(config map[string]interface{}) error

func (*Cache) InsertMessage

func (c *Cache) InsertMessage(m *dns.Msg)

func (*Cache) Name

func (c *Cache) Name() string

func (*Cache) Remove

func (c *Cache) Remove(q dns.Question)

func (*Cache) Search

func (c *Cache) Search(q dns.Question) (*dns.Msg, time.Time, bool)

func (*Cache) Where

func (c *Cache) Where() uint8

type Dispatcher

type Dispatcher struct {
	Areas map[string]Area
}

func (*Dispatcher) HandleDns

func (d *Dispatcher) HandleDns(ctx *common.Context)

func (*Dispatcher) Init

func (d *Dispatcher) Init(config map[string]interface{}) error

func (*Dispatcher) Name

func (d *Dispatcher) Name() string

func (*Dispatcher) Where

func (d *Dispatcher) Where() uint8

type DispatcherConf

type DispatcherConf struct {
	Areas map[string]struct {
		DomainFile string
		Upstream   *common.DNSUpstream
	}
}

type Ipset added in v0.2.0

type Ipset struct {
	Domains map[string]*domain.Tree
	Set     map[string]*ipset.IPSet
}

func (*Ipset) HandleDns added in v0.2.0

func (i *Ipset) HandleDns(ctx *common.Context)

func (*Ipset) Init added in v0.2.0

func (i *Ipset) Init(config map[string]interface{}) error

func (*Ipset) Name added in v0.2.0

func (i *Ipset) Name() string

func (*Ipset) Where added in v0.2.0

func (i *Ipset) Where() uint8

type Logger

type Logger struct {
	LogFile string `json:"log_file"`
	// contains filtered or unexported fields
}

func (*Logger) HandleDns

func (l *Logger) HandleDns(ctx *common.Context)

func (*Logger) Init

func (l *Logger) Init(config map[string]interface{}) error

func (*Logger) Name

func (l *Logger) Name() string

func (*Logger) Where

func (l *Logger) Where() uint8

type Plugin

type Plugin interface {
	Name() string
	Init(config map[string]interface{}) error
	Where() uint8
	HandleDns(*common.Context)
}

func Get

func Get(name string) Plugin

Directories

Path Synopsis
lib
ipset
Package ipset is a library providing a wrapper to the IPtables ipset userspace utility
Package ipset is a library providing a wrapper to the IPtables ipset userspace utility

Jump to

Keyboard shortcuts

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