Documentation ¶
Overview ¶
Package ttjsv2 provides the claiming client implementation for The Things Join Server 2.0 API.
Index ¶
- type ClaimData
- type ClaimRequest
- type Component
- type Config
- type ConfigFile
- type EndDevicesErrors
- type ErrorResponse
- type KEK
- type TLSConfig
- type TTJS
- func (c *TTJS) BatchUnclaim(ctx context.Context, ids []*ttnpb.EndDeviceIdentifiers) error
- func (c *TTJS) Claim(ctx context.Context, joinEUI, devEUI types.EUI64, ...) error
- func (c *TTJS) GetClaimStatus(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers) (*ttnpb.GetClaimStatusResponse, error)
- func (c *TTJS) SupportsJoinEUI(eui types.EUI64) bool
- func (c *TTJS) Unclaim(ctx context.Context, ids *ttnpb.EndDeviceIdentifiers) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaimData ¶ added in v3.24.1
type ClaimData struct { HomeNetID string `json:"homeNetID"` HomeNSID *string `json:"homeNSID,omitempty"` Locked bool `json:"locked"` }
ClaimData contains information about the claim.
type ClaimRequest ¶ added in v3.24.1
type ClaimRequest struct { OwnerToken string `json:"ownerToken"` HomeNetID string `json:"homeNetID"` HomeNSID *string `json:"homeNSID,omitempty"` ASID string `json:"asID"` RegenerateOwnerToken *bool `json:"regenerateOwnerToken,omitempty"` Lock *bool `json:"lock,omitempty"` KEK *KEK `json:"kek,omitempty"` }
ClaimRequest is the claim request message.
func (ClaimRequest) Apply ¶ added in v3.28.1
func (req ClaimRequest) Apply(ctx context.Context, c Component) (ClaimRequest, error)
Apply applies the context to the request.
type Component ¶
type Component interface { httpclient.Provider KeyService() crypto.KeyService }
Component abstracts the component.
type Config ¶
type Config struct { NetID types.NetID NSID *types.EUI64 ASID string JoinEUIPrefixes []types.EUI64Prefix ConfigFile }
Config is the configuration for The Things Join Server claiming client.
type ConfigFile ¶ added in v3.24.1
type ConfigFile struct { URL string `yaml:"url"` TLS TLSConfig `yaml:"tls"` // BasicAuth is no longer used and is only kept for backwards compatibility. // TODO: Remove (https://github.com/TheThingsNetwork/lorawan-stack/issues/6049) BasicAuth struct { Username string `yaml:"username"` Password string `yaml:"password"` } `yaml:"basic-auth"` }
ConfigFile defines the configuration file for The Things Join Server claiming client.
type EndDevicesErrors ¶ added in v3.27.1
type EndDevicesErrors map[string]ErrorResponse
EndDevicesErrors is a map of end device identifiers to error responses.
type ErrorResponse ¶ added in v3.24.1
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse is a message that may be returned by The Things Join Server in case of an error.
type TLSConfig ¶ added in v3.24.1
type TLSConfig struct { RootCA string `yaml:"root-ca"` Source string `yaml:"source"` Certificate string `yaml:"certificate"` Key string `yaml:"key"` }
TLSConfig contains the TLS configuration.
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) BatchUnclaim ¶ added in v3.27.1
BatchUnclaim implements EndDeviceClaimer.
func (*TTJS) Claim ¶
func (c *TTJS) Claim(ctx context.Context, joinEUI, devEUI types.EUI64, claimAuthenticationCode string) error
Claim implements EndDeviceClaimer.
func (*TTJS) GetClaimStatus ¶
func (c *TTJS) GetClaimStatus( ctx context.Context, ids *ttnpb.EndDeviceIdentifiers, ) (*ttnpb.GetClaimStatusResponse, error)
GetClaimStatus implements EndDeviceClaimer.
func (*TTJS) SupportsJoinEUI ¶
SupportsJoinEUI implements EndDeviceClaimer.