publisher

package
v0.0.0-...-682d07f Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

README

Zone publisher

Input

Config and a zonefile. The zonefile MUST contain a zone. It MAY contain shards and pshards. Either the present shards and pshards are used or they are discarded and new shads and pshards are created based on the zone's content.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoPsharding

func DoPsharding(zone, ctx string, assertions []*section.Assertion,
	pshards []*section.Pshard, conf PShardingConfig, sortAssertions bool) ([]*section.Pshard, error)

DoPsharding creates pshards based on the zone's content and config.

func DoSharding

func DoSharding(zone, ctx string, assertions []*section.Assertion, shards []*section.Shard,
	config ShardingConfig, sortAssertions bool) ([]*section.Shard, error)

DoSharding creates shards based on the zone's content and config.

func LoadPrivateKeys

func LoadPrivateKeys(path string) (map[keys.PublicKeyID]interface{}, error)

LoadPrivateKeys reads private keys from the path provided in the config and returns a map from PublicKeyID to the corresponding private key data.

func StorePrivateKey

func StorePrivateKey(path string, privateKeys []keys.PrivateKey) error

Types

type BloomFilterConfig

type BloomFilterConfig struct {
	BFAlgo          section.BloomFilterAlgo
	BFHash          algorithmTypes.Hash
	BloomFilterSize int
}

BloomFilterConfig specifies the bloom filter's meta data

type Config

type Config struct {
	ZonefilePath    string
	AuthServers     []connection.Info
	PrivateKeyPath  string
	ShardingConf    ShardingConfig
	PShardingConf   PShardingConfig
	MetaDataConf    MetaDataConfig
	ConsistencyConf ConsistencyConfig
	DoSigning       bool
	MaxZoneSize     int
	OutputPath      string
	DoPublish       bool
}

Config lists configurations for publishing zone information, see zonepub flag description for detail.

func LoadConfig

func LoadConfig(configPath string) (Config, error)

LoadConfig loads configuration information from configPath

type ConsistencyConfig

type ConsistencyConfig struct {
	DoConsistencyCheck bool
	SortShards         bool
	SortZone           bool
	SigNotExpired      bool
	CheckStringFields  bool
}

ConsistencyConfig determines which consistency checks are performed prior to signing.

type MetaDataConfig

type MetaDataConfig struct {
	AddSignatureMetaData       bool
	AddSigMetaDataToAssertions bool
	AddSigMetaDataToShards     bool
	AddSigMetaDataToPshards    bool
	SignatureAlgorithm         algorithmTypes.Signature
	KeyPhase                   int
	SigValidSince              int64
	SigValidUntil              int64
	SigSigningInterval         time.Duration
}

MetaDataConfig determines how the signature meta data is generated and to which section(s) it is added.

type PShardingConfig

type PShardingConfig struct {
	IncludePshards         bool
	DoPsharding            bool
	NofAssertionsPerPshard int
	BloomFilterConf        BloomFilterConfig
}

PShardingConfig contains configuration options on how to split a zone into probabilistic shards.

type Rainspub

type Rainspub struct {
	Config Config
}

Rainspub represents the publishing process of a zone authority. It can be configured to do anything from just one step to the whole process of publishing information to the zone's authoritative servers.

func New

func New(config Config) *Rainspub

New creates a Rainspub instance and returns a pointer to it.

func (*Rainspub) Publish

func (r *Rainspub) Publish()

Publish performs various tasks of a zone's publishing process to rains servers according to its configuration. This implementation assumes that there is exactly one zone per zonefile.

type ShardingConfig

type ShardingConfig struct {
	IncludeShards         bool
	DoSharding            bool
	NofAssertionsPerShard int
	MaxShardSize          int
}

ShardingConfig contains configuration options on how to split a zone into shards.

Jump to

Keyboard shortcuts

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