threadnetwork

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package threadnetwork provides a fluent Go API over the macOS ThreadNetwork framework.

Each With… method sets one property and returns its receiver, so configuration calls can be chained.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type THClient

type THClient struct {
	objref.Handle
}

THClient is an idiomatic wrapper over the Objective-C class THClient.

A class that supports safely sharing Thread credentials between multiple clients.

func NewTHClient

func NewTHClient() *THClient

NewTHClient creates a new THClient.

func THClientFromID

func THClientFromID(id objc.ID) *THClient

THClientFromID adopts an existing Objective-C object as a THClient (nil for 0), retaining it and registering a release finalizer.

func (*THClient) CheckPreferredNetworkForActiveOperationalDatasetCompletion

func (tc *THClient) CheckPreferredNetworkForActiveOperationalDatasetCompletion(activeOperationalDataSet obj.Object, completion func(bool))

CheckPreferredNetworkForActiveOperationalDatasetCompletion determines if the essential operating parameters match the preferred network’s parameters.

func (*THClient) DeleteCredentialsForBorderAgentCompletion

func (tc *THClient) DeleteCredentialsForBorderAgentCompletion(ctx context.Context, borderAgentID obj.Object) error

DeleteCredentialsForBorderAgentCompletion deletes Thread network credentials from the framework database for a Border Agent.

DeleteCredentialsForBorderAgentCompletion blocks until the operation completes or ctx is cancelled.

func (*THClient) Description added in v0.10.0

func (tc *THClient) Description() string

Description returns the object's -description text.

func (*THClient) IsEqual added in v0.10.0

func (tc *THClient) IsEqual(other obj.Object) bool

IsEqual reports Objective-C equality (isEqual:) with another object.

func (*THClient) IsKind added in v0.10.0

func (tc *THClient) IsKind(className string) bool

IsKind reports whether the object is an instance of the named class or a subclass.

func (*THClient) IsPreferredNetworkAvailableWithCompletion

func (tc *THClient) IsPreferredNetworkAvailableWithCompletion(completion func(bool))

IsPreferredNetworkAvailableWithCompletion indicates whether a preferred network is available.

func (*THClient) RetrieveAllActiveCredentials

func (tc *THClient) RetrieveAllActiveCredentials(ctx context.Context) (result obj.Object, err error)

RetrieveAllActiveCredentials returns a set of the active credentials.

RetrieveAllActiveCredentials blocks until the operation completes or ctx is cancelled.

func (*THClient) RetrieveAllCredentials

func (tc *THClient) RetrieveAllCredentials(ctx context.Context) (result obj.Object, err error)

RetrieveAllCredentials requests all Thread credentials from the framework.

RetrieveAllCredentials blocks until the operation completes or ctx is cancelled.

func (*THClient) RetrieveCredentialsForBorderAgentCompletion

func (tc *THClient) RetrieveCredentialsForBorderAgentCompletion(ctx context.Context, borderAgentID obj.Object) (result *THCredentials, err error)

RetrieveCredentialsForBorderAgentCompletion requests Thread credentials for a Border Agent.

RetrieveCredentialsForBorderAgentCompletion blocks until the operation completes or ctx is cancelled.

func (*THClient) RetrieveCredentialsForExtendedPANIDCompletion

func (tc *THClient) RetrieveCredentialsForExtendedPANIDCompletion(ctx context.Context, extendedPANID obj.Object) (result *THCredentials, err error)

RetrieveCredentialsForExtendedPANIDCompletion requests Thread credentials for an extended Personal Area Network (PAN) ID.

RetrieveCredentialsForExtendedPANIDCompletion blocks until the operation completes or ctx is cancelled.

func (*THClient) RetrievePreferredCredentials

func (tc *THClient) RetrievePreferredCredentials(ctx context.Context) (result *THCredentials, err error)

RetrievePreferredCredentials requests Thread credentials for the preferred network.

RetrievePreferredCredentials blocks until the operation completes or ctx is cancelled.

func (*THClient) StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion

func (tc *THClient) StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion(ctx context.Context, borderAgentID obj.Object, activeOperationalDataSet obj.Object) error

StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion stores Thread network credentials into the framework database that a Border Agent provides.

StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion blocks until the operation completes or ctx is cancelled.

func (*THClient) String added in v0.10.0

func (tc *THClient) String() string

String returns the object's -description text, so a wrapper prints usefully under fmt.

type THCredentials

type THCredentials struct {
	objref.Handle
}

THCredentials is an idiomatic wrapper over the Objective-C class THCredentials.

A class that contains credentials for a Thread network.

func NewTHCredentials

func NewTHCredentials() *THCredentials

NewTHCredentials creates a new THCredentials.

func THCredentialsFromID

func THCredentialsFromID(id objc.ID) *THCredentials

THCredentialsFromID adopts an existing Objective-C object as a THCredentials (nil for 0), retaining it and registering a release finalizer.

func (*THCredentials) ActiveOperationalDataSet

func (tc *THCredentials) ActiveOperationalDataSet() obj.Object

ActiveOperationalDataSet returns the essential operational parameters for the Thread network. The framework parses this property, then extracts and sets “THCredentials/channel“, “THCredentials/extendedPANID“, “THCredentials/networkKey“, “THCredentials/networkName“, “THCredentials/panID“, and “THCredentials/PSKC“ when you call “THClient/storeCredentialsForBorderAgent:activeOperationalDataSet:completion:“.

func (*THCredentials) BorderAgentID

func (tc *THCredentials) BorderAgentID() obj.Object

BorderAgentID returns the identifer of an active Thread network Border Agent. This property’s value is the MAC Extended Address, a random identifier that the active Thread network border router generates.

func (*THCredentials) Channel

func (tc *THCredentials) Channel() uint8

Channel returns the Thread network radio channel.

func (*THCredentials) CreationDate

func (tc *THCredentials) CreationDate() obj.Object

CreationDate returns the date and time that the framework stored the credential in the database.

func (*THCredentials) Description added in v0.10.0

func (tc *THCredentials) Description() string

Description returns the object's -description text.

func (*THCredentials) ExtendedPANID

func (tc *THCredentials) ExtendedPANID() obj.Object

ExtendedPANID returns the Thread network extended PAN identifier.

func (*THCredentials) IsEqual added in v0.10.0

func (tc *THCredentials) IsEqual(other obj.Object) bool

IsEqual reports Objective-C equality (isEqual:) with another object.

func (*THCredentials) IsKind added in v0.10.0

func (tc *THCredentials) IsKind(className string) bool

IsKind reports whether the object is an instance of the named class or a subclass.

func (*THCredentials) LastModificationDate

func (tc *THCredentials) LastModificationDate() obj.Object

LastModificationDate returns the date and time that the framework updated the credential in the database.

func (*THCredentials) NetworkKey

func (tc *THCredentials) NetworkKey() obj.Object

NetworkKey returns the sixteen byte Thread network key.

func (*THCredentials) NetworkName

func (tc *THCredentials) NetworkName() string

NetworkName returns the Thread network name.

func (*THCredentials) PSKC

func (tc *THCredentials) PSKC() obj.Object

PSKC returns the sixteen byte Thread network pre-shared key for the Commissioner.

func (*THCredentials) PanID

func (tc *THCredentials) PanID() obj.Object

PanID returns the two byte Thead network PAN identifier.

func (*THCredentials) String added in v0.10.0

func (tc *THCredentials) String() string

String returns the object's -description text, so a wrapper prints usefully under fmt.

func (*THCredentials) WithChannel

func (tc *THCredentials) WithChannel(channel uint8) *THCredentials

WithChannel sets the Thread network radio channel.

Jump to

Keyboard shortcuts

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