restful

package
v0.0.0-...-e85cc61 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string `json:"message"`
}

type Response

type Response struct {
	StatusCode int         `json:"statusCode"`
	Data       interface{} `json:"data"`
	Error      *Error      `json:"error"`
}

func ResponseBadRequest

func ResponseBadRequest(message string) *Response

func ResponseNotFound

func ResponseNotFound(message string) *Response

func ResponseOk

func ResponseOk(data interface{}) *Response

func ResponseServerError

func ResponseServerError(message string) *Response

type Server

type Server struct {
	ServerConfig
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg ServerConfig, bc *core.Blockchain, txChan chan *types.Transaction, privateKey *types.PrivateKey) *Server

func (*Server) Start

func (s *Server) Start() error

type ServerConfig

type ServerConfig struct {
	Logger     log.Logger
	ListenAddr string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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