util

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string, object interface{}) error

Load fetches the gob encoded object from the file located at path

func NewNotificationMessage

func NewNotificationMessage(tok token.Token, t section.NotificationType, data string) message.Message

NewNotificationMessage creates a new message containing one notification body with values obtained from the input parameter

func NewNotificationsMessage

func NewNotificationsMessage(tokens []token.Token, types []section.NotificationType, data []string) (message.Message, error)

NewNotificationsMessage creates a new message containing notification bodies with values obtained from the input parameter

func NewQueryMessage

func NewQueryMessage(name, context string, expTime int64, objType []object.Type,
	queryOptions []query.Option, token token.Token) message.Message

NewQueryMessage creates a new message containing a query body with values obtained from the input parameter

func Save

func Save(path string, object interface{}) error

Save stores the object to the file located at the specified path gob encoded.

func SendQuery

func SendQuery(msg message.Message, connInfo connection.Info, timeout time.Duration) (
	message.Message, error)

SendQuery creates a connection with connInfo, frames msg and writes it to the connection. It then waits for the response. When it receives the response or times out, it returns the answer or an error.

func UpdateSectionValidity

func UpdateSectionValidity(sec section.WithSig, pkeyValidSince, pkeyValidUntil, sigValidSince, sigValidUntil int64, maxVal MaxCacheValidity)

UpdateSectionValidity updates the validity of the section according to the signature validity and the publicKey validity used to verify this signature

Types

type MaxCacheValidity

type MaxCacheValidity struct {
	AssertionValidity        time.Duration
	ShardValidity            time.Duration
	PhardValidity            time.Duration
	ZoneValidity             time.Duration
	AddressAssertionValidity time.Duration
}

MaxCacheValidity defines the maximum duration each section containing signatures can be valid, starting from time.Now()

Jump to

Keyboard shortcuts

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