invite

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 14 Imported by: 2

Documentation

Overview

Package invite contains functions for parsing invite codes and dialing a pub as a guest to redeem a token. The muxrpc handlers and storage are found in plugins/legacyinvite.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidToken = errors.New("invite: invalid token")

Functions

func NewPubMessageFromToken

func NewPubMessageFromToken(tok Token) (*refs.OldPubMessage, error)

func Redeem

func Redeem(ctx context.Context, tok Token, longTerm refs.FeedRef) error

Redeem takes an invite token and a long term key. It uses the information in the token to build a guest-client connection and place an 'invite.use' rpc call with it's longTerm key. If the peer responds with a message it returns nil

Types

type Token

type Token struct {
	Peer    refs.FeedRef
	Address net.Addr

	Seed [32]byte
}

func ParseLegacyToken

func ParseLegacyToken(input string) (Token, error)

ParseLegacyToken takes an legacy invite token of the form host:port:@feed.Ref~base64Seed

func (Token) String

func (c Token) String() string

Jump to

Keyboard shortcuts

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