util

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2016 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BWStatusUnchecked      = 0
	BWStatusOkay           = 200
	BWStatusOkayAsResolved = 201
	BWStatusUnresolvable   = 401
	BWStatusInvalidDOT     = 402
	BWStatusInvalidSig     = 403
	BWStatusTTLExpired     = 404
	BWStatusBadPermissions = 405
	//In Anarchy we are assuming that all messages are delivered on a channel
	//that matches the origin VK of the messages. This indicates a mismatch
	//of that assumption
	BWStatusOriginVKMismatch = 406
	//Using an ALL dchain but no origin RO
	BWStatusNoOrigin = 407
	BWStatusBadURI   = 408
	//Returned if you try to publish to a wildcard
	BWStatusBadOperation      = 409
	BWStatusMVKMismatch       = 410
	BWStatusMalformedMessage  = 411
	BWStatusAffinityMismatch  = 412
	BWStatusPeerError         = 413
	BWStatusExpiredDOT        = 414
	BWStatusExpiredEntity     = 415
	BWStatusRevokedDOT        = 416
	BWStatusRevokedEntity     = 417
	BWStatusChainOriginNotMVK = 418
	BWStatusInvalidEntity     = 419
	//Returned when a permission RO is used where an access RO is required
	BWStatusNotAccessRO = 420
	//Returned when a DChain has a DOT whose src is not the previous dst
	BWStatusBadLink = 421
	//Returned when a URI is invalid after being constrained by DOTs
	BWStatusOverconstrainedURI = 422
	//Returned if you attempt to send a message without having an entity
	BWStatusNoEntity = 423
)

Variables

This section is empty.

Functions

func AnalyzeSuffix

func AnalyzeSuffix(uri string) (valid, hasStar, hasPlus, hasDollar, hasBang bool)

AnalyzeSuffix checks a given URI for schema validity and possession of characteristics

func ParseDuration

func ParseDuration(s string) (*time.Duration, error)

ParseDuration is a little like the existing time.ParseDuration but adds days and years because its really annoying not having that

func RestrictBy

func RestrictBy(from string, by string) (string, bool)

RestrictBy takes a topic, and a permission, and returns the intersection that represents the from topic restricted by the permission. It took a looong time to work out this logic...

func VerifyMVK

func VerifyMVK(mvk []byte) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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