server

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

A Server is a collection of modules that can be communicated with over an http API.

func New

func New(config *persist.SatdConfig, apiPassword string, dbPassword string, loadStartTime time.Time) (*Server, error)

New creates a new API server. The API will require authentication using HTTP basic auth if the supplied password is not the empty string. Usernames are ignored for authentication. This type of authentication sends passwords in plaintext and should therefore only be used if the apiAddr is localhost.

func NewAsync

func NewAsync(config *persist.SatdConfig, apiPassword string, dbPassword string, loadStartTime time.Time) (*Server, <-chan error)

NewAsync creates a new API server. The API will require authentication using HTTP basic auth if the supplied password is not the empty string. Usernames are ignored for authentication. This type of authentication sends passwords in plaintext and should therefore only be used if the apiAddr is localhost.

func (*Server) APIAddress

func (srv *Server) APIAddress() string

APIAddress returns the underlying node's api address.

func (*Server) Close

func (srv *Server) Close() error

Close closes the Server's listener, causing the HTTP server to shut down.

func (*Server) GatewayAddress

func (srv *Server) GatewayAddress() modules.NetAddress

GatewayAddress returns the underlying node's gateway address.

func (*Server) ServeErr

func (srv *Server) ServeErr() <-chan error

ServeErr is a blocking call that will return the result of srv.serve after the server stopped.

func (*Server) Unlock

func (srv *Server) Unlock(password string) error

Unlock unlocks the wallet using the provided password.

func (*Server) WaitClose

func (srv *Server) WaitClose()

WaitClose blocks until the server is done shutting down.

Jump to

Keyboard shortcuts

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