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) PurchaseTokens ¶
func (ta *Client) PurchaseTokens()
PurchaseTokens purchases the given number of tokens from the server (using the provided payment handler)
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