joinserver

package
v2.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	JoinReq(pl backend.JoinReqPayload) (backend.JoinAnsPayload, error)
	RejoinReq(pl backend.RejoinReqPayload) (backend.RejoinAnsPayload, error)
}

Client defines the join-server client interface.

func NewClient

func NewClient(server, caCert, tlsCert, tlsKey string) (Client, error)

NewClient creates a new join-server client. If the caCert is set, it will configure the CA certificate to validate the join-server server certificate. When the tlsCert and tlsKey are set, then these will be configured as client-certificates for authentication.

type Config

type Config struct {
	Pool                Pool
	ResolveJoinEUI      bool   `mapstructure:"resolve_join_eui"`
	ResolveDomainSuffix string `mapstructure:"resolve_domain_suffix"`

	Certificates []struct {
		JoinEUI string `mapstructure:"join_eui"`
		CaCert  string `mapstructure:"ca_cert"`
		TLSCert string `mapstructure:"tls_cert"`
		TLSKey  string `mapstructure:"tls_key"`
	} `mapstructure:"certificates"`

	Default struct {
		Server  string
		CACert  string `mapstructure:"ca_cert"`
		TLSCert string `mapstructure:"tls_cert"`
		TLSKey  string `mapstructure:"tls_key"`
	}

	KEK struct {
		Set []struct {
			Label string
			KEK   string `mapstructure:"kek"`
		}
	} `mapstructure:"kek"`
}

Config holds the join-server configuration.

type Pool

type Pool interface {
	Get(joinEUI lorawan.EUI64) (Client, error)
}

Pool defines the join-server client pool.

func NewPool

func NewPool(config Config) (Pool, error)

NewPool creates a new Pool.

Jump to

Keyboard shortcuts

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