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 ¶
APIAddress returns the underlying node's api address.
func (*Server) GatewayAddress ¶
func (srv *Server) GatewayAddress() modules.NetAddress
GatewayAddress returns the underlying node's gateway address.
func (*Server) ServeErr ¶
ServeErr is a blocking call that will return the result of srv.serve after the server stopped.