models

package
v0.0.0-...-07846f8 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveToken

func RemoveToken(t string)

RemoveToken removes the token from the tokensmap

Types

type Receiver

type Receiver struct {
	*Token
	// contains filtered or unexported fields
}

Receiver gets the secret from the supplier

func RegisterReceiver

func RegisterReceiver(ws *websocket.Conn) Receiver

RegisterReceiver creates a new receiver

type Token

type Token struct {
	Uuid string
}

Token is used for handshaking a receiver and a supplier

func NewToken

func NewToken() *Token

NewToken creates a token object and returns it to the receiver

type WsMessage

type WsMessage struct {
	Status     string `json:"status"`
	TokenStr   string `json:"token"`
	Secret     string `json:"secret"`
	Passphrase bool   `json:"key"`
}

WsMessage takes care of sending the message from supplier to receiver

func (*WsMessage) TransferSecret

func (m *WsMessage) TransferSecret(c echo.Context) error

TransferSecret ships the secret

Jump to

Keyboard shortcuts

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