api

package
v0.0.0-...-42befb5 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package api provides the local go-spacemesh API endpoints. e.g. json-http and grpc-http2

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONHTTPServer

type JSONHTTPServer struct {
	Port uint
	// contains filtered or unexported fields
}

JSONHTTPServer is a JSON http server providing the Spacemesh API. It is implemented using a grpc-gateway. See https://github.com/grpc-ecosystem/grpc-gateway.

func NewJSONHTTPServer

func NewJSONHTTPServer() *JSONHTTPServer

NewJSONHTTPServer creates a new json http server.

func (JSONHTTPServer) StartService

func (s JSONHTTPServer) StartService(status chan bool)

StartService starts the json api server and listens for status (started, stopped).

func (JSONHTTPServer) StopService

func (s JSONHTTPServer) StopService()

StopService stops the server.

type SpaceMeshGrpcService

type SpaceMeshGrpcService struct {
	Server *grpc.Server
	Port   uint
}

SpaceMeshGrpcService is a grpc server providing the Spacemesh api

func NewGrpcService

func NewGrpcService() *SpaceMeshGrpcService

NewGrpcService create a new grpc service using config data.

func (SpaceMeshGrpcService) Echo

Echo returns the response for an echo api request

func (SpaceMeshGrpcService) StartService

func (s SpaceMeshGrpcService) StartService(status chan bool)

StartService starts the grpc service.

func (SpaceMeshGrpcService) StopService

func (s SpaceMeshGrpcService) StopService()

StopService stops the grpc service.

Directories

Path Synopsis
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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