legacyinvites

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: 1

Documentation

Overview

Package legacyinvites supplies the follow-back sub protocol for new users. Translates to npm:ssb-invite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateArguments added in v0.2.1

type CreateArguments struct {
	// how many times this invite should be useable
	Uses uint `json:"uses"`

	// a note to organize invites (also posted when used)
	Note string `json:"note,omitempty"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service holds all the utility functions for invite managment

func New

func New(
	logger kitlog.Logger,
	r repo.Interface,
	self refs.FeedRef,
	nw ssb.Network,
	publish ssb.Publisher,
	rlog margaret.Log,
	rep ssb.Replicator,
	db *badger.DB,
) (*Service, error)

New creates a new invite plugin service

func (*Service) Authorize

func (s *Service) Authorize(to refs.FeedRef) error

Authorize allows a connection of the guest keypair is known to the service and not yet expired

func (*Service) Create

func (s *Service) Create(uses uint, note string) (*invite.Token, error)

Create creates a new invite with a note attached and a number of uses before it expires.

func (*Service) GuestHandler

func (s *Service) GuestHandler() muxrpc.Handler

GuestHandler returns the handler to accept invites

func (*Service) MasterPlugin

func (s *Service) MasterPlugin() ssb.Plugin

MasterPlugin exposes a muxrpc handler with elevated methods, which can be used to create invites

Jump to

Keyboard shortcuts

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