cassandra

package module
v0.0.0-...-f4c6be8 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

cassandra

Cassandra backed plugin for CoreDNS

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseHostFromQname

func ParseHostFromQname(qname, zone string) string

Types

type Cassandra

type Cassandra struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

func NewCassandraPlugin

func NewCassandraPlugin(db CassandraBackend) *Cassandra

func (*Cassandra) Name

func (c *Cassandra) Name() string

func (*Cassandra) ServeDNS

func (c *Cassandra) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

type CassandraBackend

type CassandraBackend interface {
	Zones() []string
	CreateZone(name string) error
	GetRecords(zone string, host string, qtype uint16, class uint16) ([]dns.RR, []dns.RR, error)
	InsertRecord(zone string, rr dns.RR) error
}

type CassandraDatastore

type CassandraDatastore struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

func NewCassandraDatastore

func NewCassandraDatastore(conn []string, keyspace string) *CassandraDatastore

func (*CassandraDatastore) CreateZone

func (c *CassandraDatastore) CreateZone(name string) error

CreateZone will add a new zone SOA to the database.

func (*CassandraDatastore) GetRecords

func (c *CassandraDatastore) GetRecords(zone string, host string, qtype uint16, class uint16) ([]dns.RR, []dns.RR, error)

func (*CassandraDatastore) InsertRecord

func (c *CassandraDatastore) InsertRecord(zone string, rr dns.RR) error

func (*CassandraDatastore) Zones

func (c *CassandraDatastore) Zones() []string

Zones returns a list of all zones in CassandraDatastore. If no zones exist, returns an empty slice.

type CassandraMock

type CassandraMock struct {
	// contains filtered or unexported fields
}

CassandraMock is a mock Cassandra datastore for testing purposes. It has limited support for SOA, A, and CNAME types

func NewCassandraMock

func NewCassandraMock(soa map[string]dns.SOA, a map[string]map[string]dns.RR, cname map[string]map[string]dns.RR) *CassandraMock

NewCassandraMock is a generator for creating new CassandraMock instances

func (*CassandraMock) CreateZone

func (cm *CassandraMock) CreateZone(name string) error

func (*CassandraMock) GetRecords

func (cm *CassandraMock) GetRecords(zone string, host string, qtype uint16, class uint16) ([]dns.RR, []dns.RR, error)

func (*CassandraMock) InsertRecord

func (cm *CassandraMock) InsertRecord(zone string, rr dns.RR) error

func (*CassandraMock) Zones

func (cm *CassandraMock) Zones() []string

Jump to

Keyboard shortcuts

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