Documentation
¶
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 ¶
- type THClient
- func (tc *THClient) CheckPreferredNetworkForActiveOperationalDatasetCompletion(activeOperationalDataSet obj.Object, completion func(bool))
- func (tc *THClient) DeleteCredentialsForBorderAgentCompletion(ctx context.Context, borderAgentID obj.Object) error
- func (tc *THClient) Description() string
- func (tc *THClient) IsEqual(other obj.Object) bool
- func (tc *THClient) IsKind(className string) bool
- func (tc *THClient) IsPreferredNetworkAvailableWithCompletion(completion func(bool))
- func (tc *THClient) RetrieveAllActiveCredentials(ctx context.Context) (result obj.Object, err error)
- func (tc *THClient) RetrieveAllCredentials(ctx context.Context) (result obj.Object, err error)
- func (tc *THClient) RetrieveCredentialsForBorderAgentCompletion(ctx context.Context, borderAgentID obj.Object) (result *THCredentials, err error)
- func (tc *THClient) RetrieveCredentialsForExtendedPANIDCompletion(ctx context.Context, extendedPANID obj.Object) (result *THCredentials, err error)
- func (tc *THClient) RetrievePreferredCredentials(ctx context.Context) (result *THCredentials, err error)
- func (tc *THClient) StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion(ctx context.Context, borderAgentID obj.Object, ...) error
- func (tc *THClient) String() string
- type THCredentials
- func (tc *THCredentials) ActiveOperationalDataSet() obj.Object
- func (tc *THCredentials) BorderAgentID() obj.Object
- func (tc *THCredentials) Channel() uint8
- func (tc *THCredentials) CreationDate() obj.Object
- func (tc *THCredentials) Description() string
- func (tc *THCredentials) ExtendedPANID() obj.Object
- func (tc *THCredentials) IsEqual(other obj.Object) bool
- func (tc *THCredentials) IsKind(className string) bool
- func (tc *THCredentials) LastModificationDate() obj.Object
- func (tc *THCredentials) NetworkKey() obj.Object
- func (tc *THCredentials) NetworkName() string
- func (tc *THCredentials) PSKC() obj.Object
- func (tc *THCredentials) PanID() obj.Object
- func (tc *THCredentials) String() string
- func (tc *THCredentials) WithChannel(channel uint8) *THCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type THClient ¶
THClient is an idiomatic wrapper over the Objective-C class THClient.
A class that supports safely sharing Thread credentials between multiple clients.
func THClientFromID ¶
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
Description returns the object's -description text.
func (*THClient) IsEqual ¶ added in v0.10.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*THClient) IsKind ¶ added in v0.10.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*THClient) IsPreferredNetworkAvailableWithCompletion ¶
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 ¶
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.
type THCredentials ¶
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.