ttjsv2

package
v3.24.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package ttjsv2 provides the claiming client implementation for The Things Join Server 2.0 API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

BasicAuth contains HTTP basic auth settings.

type Component

type Component interface {
	httpclient.Provider
	GetBaseConfig(ctx context.Context) config.ServiceBase
	GetPeerConn(ctx context.Context, role ttnpb.ClusterRole, ids cluster.EntityIdentifiers) (*grpc.ClientConn, error)
	AllowInsecureForCredentials() bool
}

Component abstracts the underlying *component.Component.

type Config

type Config struct {
	NetID           types.NetID         `yaml:"-"`
	JoinEUIPrefixes []types.EUI64Prefix `yaml:"-"`
	NetworkServer   NetworkServer       `yaml:"-"`

	BasicAuth `yaml:"basic-auth"`
	URL       string `yaml:"url"`
}

Config is the configuration to communicate with The Things Join Server End Device Claming API.

func (*Config) NewClient

func (cfg *Config) NewClient(ctx context.Context, c Component) (*TTJS, error)

NewClient applies the config and returns a new TTJS client.

type NetworkServer

type NetworkServer struct {
	Hostname string
	HomeNSID *types.EUI64
}

NetworkServer contains information related to the Network Server.

type TTJS

type TTJS struct {
	Component
	// contains filtered or unexported fields
}

TTJS is a client that claims end devices on a The Things Join Server.

func (*TTJS) Claim

func (client *TTJS) Claim(ctx context.Context, joinEUI, devEUI types.EUI64, claimAuthenticationCode string) error

Claim implements EndDeviceClaimer.

func (*TTJS) GetClaimStatus

func (client *TTJS) GetClaimStatus(
	ctx context.Context, ids *ttnpb.EndDeviceIdentifiers,
) (*ttnpb.GetClaimStatusResponse, error)

GetClaimStatus implements EndDeviceClaimer.

func (*TTJS) SupportsJoinEUI

func (client *TTJS) SupportsJoinEUI(eui types.EUI64) bool

SupportsJoinEUI implements EndDeviceClaimer.

func (*TTJS) Unclaim

func (client *TTJS) Unclaim(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers) error

Unclaim implements EndDeviceClaimer.

Jump to

Keyboard shortcuts

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