api

package module
v0.0.0-...-5a7537d Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const EventPubSub = "e"

EventPubSub is the pub/sub name for events.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(b []byte, v interface{}, secretKey *[32]byte) error

Decrypt data into value (msgpack).

func Encrypt

func Encrypt(i interface{}, secretKey *[32]byte) ([]byte, error)

Encrypt value into data (msgpack).

Types

type Event

type Event struct {
	KID   keys.ID `json:"kid,omitempty" msgpack:"k,omitempty"`
	User  keys.ID `json:"user,omitempty" msgpack:"u,omitempty"`
	Index int64   `json:"idx,omitempty" msgpack:"i,omitempty"`
	Token string  `json:"token,omitempty" msgpack:"t,omitempty"`
}

Event to client. JSON is used for websocket clients.

Directories

Path Synopsis
api module
client module
server module

Jump to

Keyboard shortcuts

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