Documentation ¶
Overview ¶
Package peer implements the basic data types needed to communicate with other brig instances.
user[@domain[/resource]
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrBadName ¶
type ErrBadName struct {
// contains filtered or unexported fields
}
ErrBadName is returned for invalidly formatted peer names.
func (ErrBadName) Error ¶
func (e ErrBadName) Error() string
type Fingerprint ¶
type Fingerprint string
Fingerprint encodes the addr of a remote and an ID (i.e. hash) of the remote's public key. It is later used to verify if a remote's addr or pubkey has changed and is presented to the user as initial identification token for another user.
func BuildFingerprint ¶
func BuildFingerprint(addr string, pubKeyData []byte) Fingerprint
BuildFingerprint builds a fingerprint from `addr` and a public key.
func CastFingerprint ¶
func CastFingerprint(s string) (Fingerprint, error)
CastFingerprint converts and checks `s` to be a valid Fingerprint.
func (Fingerprint) Addr ¶
func (fp Fingerprint) Addr() string
Addr returns the addr part of a fingerprint.
func (Fingerprint) PubKeyID ¶
func (fp Fingerprint) PubKeyID() string
PubKeyID returns the public key hash in the fingerprint.
func (Fingerprint) PubKeyMatches ¶
func (fp Fingerprint) PubKeyMatches(pubKeyData []byte) bool
PubKeyMatches checks if the supplied public key matches with the hashed version in the fingerprint.
type Name ¶
type Name string
Name is the display name of a peer. (i.e. how another repo calls itself)
func (Name) WithoutResource ¶
WithoutResource returns the same peer name without its resource part.