Documentation ¶
Index ¶
Constants ¶
View Source
const (
AllowedClockSkew = time.Second * 5
)
Variables ¶
View Source
var ( ErrDestinationBadChar = errors.New("destination contains forbidden character") ErrVerbBadChar = errors.New("verb contains forbidden character") ErrNoPrivateKey = errors.New("no private key with sender permission found") ErrFormat = errors.New("message format corrupt") ErrSignature = errors.New("signature corrupt") ErrPeerPermission = errors.New("peer key or permission not known") ErrClockSkew = errors.New("message outside of time window") )
Functions ¶
func MatchWildcards ¶
MatchWildcards returns true if s matches pattern '*' matches between dots may only occur once between dots. '**' matches beyond dots. May only appear at end of pattern.
func NewUUID ¶
NewUUID creates a new UUID. If the given one is too long, it will be hashed. If none is given, a random one is created.
func RandomBytes ¶
Types ¶
type Base58Bytes ¶
type Base58Bytes []byte
func (*Base58Bytes) MarshalJSON ¶
func (b58b *Base58Bytes) MarshalJSON() ([]byte, error)
func (*Base58Bytes) UnmarshalJSON ¶
func (b58b *Base58Bytes) UnmarshalJSON(d []byte) error
type Config ¶
type Config struct { NATSUrl []string NATSCredsFile string Subject string DefaultKey Base58Bytes Destination string AllowedClockSkew time.Duration Identities Identities Peers Peers }
func (*Config) PotentialReceivers ¶
func (*Config) PrivateKey ¶
type Identities ¶
type Identities []Identity
type Identity ¶
type Identity struct { PublicKey Base58Bytes PrivateKey Base58Bytes Permissions []string }
func (*Identity) HasPermission ¶
type Message ¶
type Message struct { SenderPublicKey Base58Bytes SenderSignature Base58Bytes Destination string RequestReply bool SendTimeNano int64 UUID []byte Verb string Payload string Hash []byte }
type Peer ¶
type Peer struct { PublicKey Base58Bytes Destination string Permissions []string }
func (*Peer) HasPermission ¶
Click to show internal directories.
Click to hide internal directories.