tokenboard

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTokenBoardClient

func NewTokenBoardClient(store *auditable.Store, handler AppHandler, paymentHandler privacypass.TokenPaymentHandler) tapir.Application

NewTokenBoardClient generates a new Client for Token Board

func NewTokenBoardServer

func NewTokenBoardServer(tokenService *privacypass.TokenServer, store *auditable.Store) tapir.Application

NewTokenBoardServer generates new Server for Token Board

Types

type AppHandler

type AppHandler interface {
	HandleNewMessages(previousLastCommit []byte)
}

AppHandler allows clients to react to specific events.

type Client

type Client struct {
	applications.AuthApp

	AuditableStore *auditable.Store
	// contains filtered or unexported fields
}

Client defines a client for the TokenBoard server

func (*Client) Init

func (ta *Client) Init(connection tapir.Connection)

Init initializes the cryptographic TokenBoardApp

func (*Client) Listen

func (ta *Client) Listen()

Listen processes the messages for this application

func (*Client) NewInstance

func (ta *Client) NewInstance() tapir.Application

NewInstance Client a new TokenBoardApp

func (*Client) Post

func (ta *Client) Post(message auditable.Message) bool

Post sends a Post Request to the server

func (*Client) PurchaseTokens

func (ta *Client) PurchaseTokens()

PurchaseTokens purchases the given number of tokens from the server (using the provided payment handler)

func (*Client) Replay

func (ta *Client) Replay()

Replay posts a Replay Message to the server.

type Message

type Message struct {
	MessageType   messageType
	PostRequest   postRequest   `json:",omitempty"`
	PostResult    postResult    `json:",omitempty"`
	ReplayRequest replayRequest `json:",omitempty"`
	ReplayResult  replayResult  `json:",omitempty"`
}

Message encapsulates the application protocol

type Server

type Server struct {
	applications.AuthApp

	TokenService   *privacypass.TokenServer
	AuditableStore *auditable.Store
	// contains filtered or unexported fields
}

Server defines the token board server

func (*Server) Init

func (ta *Server) Init(connection tapir.Connection)

Init initializes the cryptographic TokenBoardApp

func (*Server) Listen

func (ta *Server) Listen()

Listen processes the messages for this application

func (*Server) NewInstance

func (ta *Server) NewInstance() tapir.Application

NewInstance creates a new TokenBoardApp

Jump to

Keyboard shortcuts

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