server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 27 Imported by: 1

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

This section is empty.

Functions

func StartArgs

func StartArgs(args []string) error

StartArgs starts SIOT with more command line style args

func TestServer added in v0.4.0

func TestServer() (*nats.Conn, data.NodeEdge, func(), error)

TestServer starts a test server and returns a function to stop it

Types

type Options

type Options struct {
	StoreFile         string
	DataDir           string
	HTTPPort          string
	DebugHTTP         bool
	DebugLifecycle    bool
	DisableAuth       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
}

Options used for starting Simple IoT

type Server

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

Server represents a SIOT server process

func NewServer

func NewServer(o Options) (*Server, *nats.Conn, error)

NewServer creates a new server

func (*Server) Start

func (s *Server) Start() error

Start the server -- only returns if there is an error

func (*Server) Stop

func (s *Server) Stop(err error)

Stop server

func (*Server) WaitStart

func (s *Server) WaitStart(ctx context.Context) error

WaitStart waits for server to start. Clients should wait for this to complete before trying to fetch nodes, etc.

Jump to

Keyboard shortcuts

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