Documentation
¶
Overview ¶
Package server is used to start up the SIOT server, which includes NATS, the store, various built in clients, and HTTP API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrServerStopped = errors.New("Server stopped")
ErrServerStopped is returned when the server is stopped
View Source
var TestServerOptions = Options{
StoreFile: "test.sqlite",
NatsPort: 8900,
HTTPPort: "8901",
NatsHTTPPort: 8902,
NatsWSPort: 8903,
NatsServer: "nats://localhost:8900",
ID: "inst1",
}
TestServerOptions options used for test server
View Source
var TestServerOptions2 = Options{
StoreFile: "test2.sqlite",
NatsPort: 8910,
HTTPPort: "8911",
NatsHTTPPort: 8912,
NatsWSPort: 8913,
NatsServer: "nats://localhost:8910",
ID: "inst2",
}
TestServerOptions2 options used for 2nd test server
Functions ¶
Types ¶
type Options ¶
type Options struct {
StoreFile string
ResetStore bool
DataDir string
HTTPPort string
DebugHTTP bool
DebugLifecycle bool
NatsServer string
NatsDisableServer bool
NatsPort int
NatsHTTPPort int
NatsWSPort int
NatsTLSCert string
NatsTLSKey string
NatsTLSTimeout float64
AuthToken string
ParticleAPIKey string
AppVersion string
OSVersionField string
LogNats bool
Dev bool
CustomUIDir string
CustomUIFS fs.FS
UIAssetsDebug bool
// optional ID (must be unique) for this instance, otherwise, a UUID will be used
ID string
}
Options used for starting Simple IoT
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a SIOT server process
func (*Server) AddClient ¶ added in v0.5.2
AddClient can be used to add clients to the server. Clients must be added before start is called. The Server makes sure all clients are shut down before shutting down the server. This makes for a cleaner shutdown.
Click to show internal directories.
Click to hide internal directories.