api

package
v0.0.0-...-a092f05 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("api server")

Error is an error class for API http server error.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address string
}

Config holds API endpoint configuration.

type Server

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

Server represents storjscan API web server.

architecture: Endpoint

func NewServer

func NewServer(log *zap.Logger, listener net.Listener) *Server

NewServer creates new API server instance.

func (*Server) Close

func (server *Server) Close() error

Close closes server and underlying listener.

func (*Server) NewAPI

func (server *Server) NewAPI(path string, register func(*mux.Router))

NewAPI creates new API route and register endpoint methods.

func (*Server) Register

func (server *Server) Register(register func(*mux.Router))

func (*Server) Run

func (server *Server) Run(ctx context.Context) (err error)

Run runs the server that host api endpoints.

Jump to

Keyboard shortcuts

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