Documentation ¶
Overview ¶
Package profilefetcher contains definitions of end-device's profile fetchers based on the VersionIDs or VendorIDs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContextWithFetcher ¶
func NewContextWithFetcher(ctx context.Context, tf TemplateFetcher) context.Context
NewContextWithFetcher returns a context with the TemplateFetcher.
Types ¶
type Component ¶
type Component interface { GetPeerConn(ctx context.Context, role ttnpb.ClusterRole, ids cluster.EntityIdentifiers) (*grpc.ClientConn, error) AllowInsecureForCredentials() bool }
Component abstracts the underlying *component.Component.
type EndDeviceProfileFetcher ¶
type EndDeviceProfileFetcher interface { ShouldFetchProfile(*ttnpb.EndDevice) bool FetchProfile(context.Context, *ttnpb.EndDevice) (*ttnpb.EndDeviceTemplate, error) }
EndDeviceProfileFetcher specifies the necessary methods to ascertain if the end device contains the necessary information to make the profile template request and for performing the request itself.
func NewFetcherByVendorIDs ¶
func NewFetcherByVendorIDs() EndDeviceProfileFetcher
NewFetcherByVendorIDs returns a end-device's profile fetcher that builds its request with vendorIDs.
func NewFetcherByVersionIDs ¶
func NewFetcherByVersionIDs() EndDeviceProfileFetcher
NewFetcherByVersionIDs returns a end-device's profile fetcher that builds its request with vendorIDs.
type TemplateFetcher ¶
type TemplateFetcher interface {
GetTemplate(ctx context.Context, in *ttnpb.GetTemplateRequest) (*ttnpb.EndDeviceTemplate, error)
}
TemplateFetcher implements the steps required to obtain a end-device template from the Device Repository.
func NewTemplateFetcher ¶
func NewTemplateFetcher(c Component) TemplateFetcher
NewTemplateFetcher returns an end-device template fetcher with predefined call options.