alias

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package alias implements the muxrpc handlers for alias needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler implements the muxrpc methods for alias registration and recvocation

func New

New returns a fresh alias muxrpc handler

func (Handler) Register

func (h Handler) Register(ctx context.Context, req *muxrpc.Request) (interface{}, error)

Register is an async muxrpc method handler for registering aliases. It receives two string arguments over muxrpc (alias and signature), checks the signature confirmation is correct (for this room and signed by the key of theconnection) If it is valid, it registers the alias on the roomdb and returns true. If not it returns an error.

func (Handler) Revoke

func (h Handler) Revoke(ctx context.Context, req *muxrpc.Request) (interface{}, error)

Revoke checks that the alias is from that user before revoking the alias from the database.

Jump to

Keyboard shortcuts

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