api

package
v0.0.0-...-804f56e Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: Zlib Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLoginFailed = errors.New("Login failed.")
	ErrNoSuchUser  = errors.New("No such user.")
)
View Source
var (
	ErrMalformedJWT = errors.New("Malformed JWT")
)

Functions

func Login

func Login(user, passwd string) ([]byte, error)

Login attempts to login to the Mercury Server. If it is successful, it returns the JWT.

func LookupUser

func LookupUser(user string) error

LookupUser checks if a user exists in Mercury's database

func MessageSend

func MessageSend(jwt []byte, peer, message string) error

MessageSend sends message to peer using the Mercrury server

func Register

func Register(user, passwd string) error

Register registers a user with the Mercury server

func SetHost

func SetHost(newHost string)

SetHost changes the host server that will be used by Quicksilver

func UnwrapJWT

func UnwrapJWT(jwt []byte) (server.Session, error)

UnwrapJWT returns the JSON payload element of a JWT

Types

type Message

type Message struct {
	Username  string
	Timestamp string
	Message   crypto.EncryptedMessage
}

Message represents Mercury's internal representation of a message

func MessageFetch

func MessageFetch(jwt []byte, peer, since string) ([]Message, error)

MessageFetch checks for messages from peer through the Mercury Server

Jump to

Keyboard shortcuts

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