threadnetwork

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type THClient

type THClient struct {
	// contains filtered or unexported fields
}

THClient wraps raw.THClient with a fluent Go API.

func NewTHClient

func NewTHClient() *THClient

NewTHClient creates a new THClient.

func THClientFromID

func THClientFromID(id objc.ID) *THClient

THClientFromID adopts an existing object pointer as a THClient (nil for 0).

func (*THClient) CheckPreferredNetworkForActiveOperationalDatasetCompletion

func (x *THClient) CheckPreferredNetworkForActiveOperationalDatasetCompletion(activeOperationalDataSet *foundation.NSData, completion func(bool))

CheckPreferredNetworkForActiveOperationalDatasetCompletion calls the underlying CheckPreferredNetworkForActiveOperationalDatasetCompletion.

func (*THClient) DeleteCredentialsForBorderAgentCompletion

func (x *THClient) DeleteCredentialsForBorderAgentCompletion(ctx context.Context, borderAgentID *foundation.NSData) error

DeleteCredentialsForBorderAgentCompletion blocks until the operation completes or ctx is cancelled.

func (*THClient) ID

func (x *THClient) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*THClient) IsPreferredNetworkAvailableWithCompletion

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

IsPreferredNetworkAvailableWithCompletion calls the underlying IsPreferredNetworkAvailableWithCompletion.

func (*THClient) RetrieveAllActiveCredentials

func (x *THClient) RetrieveAllActiveCredentials(ctx context.Context) (*foundation.NSSet[*raw.THCredentials], error)

RetrieveAllActiveCredentials blocks until the operation completes or ctx is cancelled.

func (*THClient) RetrieveAllCredentials

func (x *THClient) RetrieveAllCredentials(ctx context.Context) (*foundation.NSSet[*raw.THCredentials], error)

RetrieveAllCredentials blocks until the operation completes or ctx is cancelled.

func (*THClient) RetrieveCredentialsForBorderAgentCompletion

func (x *THClient) RetrieveCredentialsForBorderAgentCompletion(ctx context.Context, borderAgentID *foundation.NSData) (*THCredentials, error)

RetrieveCredentialsForBorderAgentCompletion blocks until the operation completes or ctx is cancelled.

func (*THClient) RetrieveCredentialsForExtendedPANIDCompletion

func (x *THClient) RetrieveCredentialsForExtendedPANIDCompletion(ctx context.Context, extendedPANID *foundation.NSData) (*THCredentials, error)

RetrieveCredentialsForExtendedPANIDCompletion blocks until the operation completes or ctx is cancelled.

func (*THClient) RetrievePreferredCredentials

func (x *THClient) RetrievePreferredCredentials(ctx context.Context) (*THCredentials, error)

RetrievePreferredCredentials blocks until the operation completes or ctx is cancelled.

func (*THClient) StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion

func (x *THClient) StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion(ctx context.Context, borderAgentID *foundation.NSData, activeOperationalDataSet *foundation.NSData) error

StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion blocks until the operation completes or ctx is cancelled.

func (*THClient) Unwrap

func (x *THClient) Unwrap() *raw.THClient

Unwrap returns the underlying raw.THClient.

type THClientable

type THClientable interface {
	Unwrap() *raw.THClient
	RetrieveAllCredentials(ctx context.Context) (*foundation.NSSet[*raw.THCredentials], error)
	RetrieveAllActiveCredentials(ctx context.Context) (*foundation.NSSet[*raw.THCredentials], error)
	DeleteCredentialsForBorderAgentCompletion(ctx context.Context, borderAgentID *foundation.NSData) error
	RetrieveCredentialsForBorderAgentCompletion(ctx context.Context, borderAgentID *foundation.NSData) (*THCredentials, error)
	StoreCredentialsForBorderAgentActiveOperationalDataSetCompletion(ctx context.Context, borderAgentID *foundation.NSData, activeOperationalDataSet *foundation.NSData) error
	RetrievePreferredCredentials(ctx context.Context) (*THCredentials, error)
	RetrieveCredentialsForExtendedPANIDCompletion(ctx context.Context, extendedPANID *foundation.NSData) (*THCredentials, error)
	CheckPreferredNetworkForActiveOperationalDatasetCompletion(activeOperationalDataSet *foundation.NSData, completion func(bool))
	IsPreferredNetworkAvailableWithCompletion(completion func(bool))
}

THClientable is the interface implemented by THClient, for mocking and DI.

type THCredentials

type THCredentials struct {
	// contains filtered or unexported fields
}

THCredentials wraps raw.THCredentials with a fluent Go API.

func NewTHCredentials

func NewTHCredentials() *THCredentials

NewTHCredentials creates a new THCredentials.

func THCredentialsFromID

func THCredentialsFromID(id objc.ID) *THCredentials

THCredentialsFromID adopts an existing object pointer as a THCredentials (nil for 0).

func (*THCredentials) ActiveOperationalDataSet

func (x *THCredentials) ActiveOperationalDataSet() *foundation.NSData

ActiveOperationalDataSet calls the underlying ActiveOperationalDataSet.

func (*THCredentials) BorderAgentID

func (x *THCredentials) BorderAgentID() *foundation.NSData

BorderAgentID calls the underlying BorderAgentID.

func (*THCredentials) Channel

func (x *THCredentials) Channel() uint8

Channel calls the underlying Channel.

func (*THCredentials) CreationDate

func (x *THCredentials) CreationDate() *foundation.NSDate

CreationDate calls the underlying CreationDate.

func (*THCredentials) ExtendedPANID

func (x *THCredentials) ExtendedPANID() *foundation.NSData

ExtendedPANID calls the underlying ExtendedPANID.

func (*THCredentials) ID

func (x *THCredentials) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*THCredentials) LastModificationDate

func (x *THCredentials) LastModificationDate() *foundation.NSDate

LastModificationDate calls the underlying LastModificationDate.

func (*THCredentials) NetworkKey

func (x *THCredentials) NetworkKey() *foundation.NSData

NetworkKey calls the underlying NetworkKey.

func (*THCredentials) NetworkName

func (x *THCredentials) NetworkName() string

NetworkName calls the underlying NetworkName.

func (*THCredentials) PSKC

func (x *THCredentials) PSKC() *foundation.NSData

PSKC calls the underlying PSKC.

func (*THCredentials) PanID

func (x *THCredentials) PanID() *foundation.NSData

PanID calls the underlying PanID.

func (*THCredentials) SetChannel

func (x *THCredentials) SetChannel(channel uint8)

SetChannel calls the underlying SetChannel.

func (*THCredentials) Unwrap

func (x *THCredentials) Unwrap() *raw.THCredentials

Unwrap returns the underlying raw.THCredentials.

func (*THCredentials) WithChannel

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

WithChannel sets the channel property and returns the receiver for chaining.

type THCredentialsable

type THCredentialsable interface {
	Unwrap() *raw.THCredentials
	WithChannel(channel uint8) *THCredentials
	NetworkName() string
	ExtendedPANID() *foundation.NSData
	BorderAgentID() *foundation.NSData
	ActiveOperationalDataSet() *foundation.NSData
	NetworkKey() *foundation.NSData
	PSKC() *foundation.NSData
	Channel() uint8
	SetChannel(channel uint8)
	PanID() *foundation.NSData
	CreationDate() *foundation.NSDate
	LastModificationDate() *foundation.NSDate
}

THCredentialsable is the interface implemented by THCredentials, for mocking and DI.

Jump to

Keyboard shortcuts

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