message

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPI

func NewAPI() transports.MessageAPI

newAPI is a required function for returning the implemented interface transports.MessageAPI This function is used by the router in order to fetch the specific type defined here.

Types

type MyAPI

type MyAPI struct {
	ID        string   `json:"request"`
	Method    string   `json:"method,omitempty"`
	PubKeys   []string `json:"pubKeys,omitempty"`
	Timestamp int32    `json:"timestamp"`
	Error     string   `json:"error,omitempty"`
	Reply     string   `json:"reply,omitempty"`
}

MyAPI is an example JSON API type compatible with transports.MessageAPI

func (*MyAPI) GetID

func (ma *MyAPI) GetID() string

GetID returns the ID for de request

func (*MyAPI) GetMethod

func (ma *MyAPI) GetMethod() string

GetMethod returns the method

func (*MyAPI) SetError

func (ma *MyAPI) SetError(e string)

SetError sets an error message

func (*MyAPI) SetID

func (ma *MyAPI) SetID(id string)

SetID sets a request ID

func (*MyAPI) SetTimestamp

func (ma *MyAPI) SetTimestamp(ts int32)

SetTimestamp sets the timestamp

Jump to

Keyboard shortcuts

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