Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotRegistered = errors.DefineInvalidArgument("not_registered", "source `{source}` is not registered") ErrAlreadyRegistered = errors.DefineInvalidArgument("already_registered", "source `{source}` is already registered") ErrNoSource = errors.DefineInvalidArgument("no_source", "no source") )
Functions ¶
func AllFlagSets ¶ added in v0.9.0
AllFlagSets returns flags for all configured sources prefixed with source names.
func Names ¶ added in v0.9.0
func Names() []string
Names returns a slice of registered Sources names.
func RegisterSource ¶
func RegisterSource(r Registration) error
RegisterSource registers a new Source.
Types ¶
type Config ¶ added in v0.9.0
type Config struct {
DryRun, Verbose bool
FrequencyPlansURL string
// contains filtered or unexported fields
}
var RootConfig Config
type CreateSource ¶
CreateSource is a function that constructs a new Source.
type Registration ¶
type Registration struct { Name, Description string Create CreateSource FlagSet *pflag.FlagSet }
Registration contains information for a registered Source.
type Source ¶
type Source interface { // ExportDevice retrieves an end device from the source and returns it as a ttnpb.EndDevice. ExportDevice(devID string) (*ttnpb.EndDevice, error) // RangeDevices calls a function for all matching devices of an application. RangeDevices(appID string, f func(s Source, devID string) error) error // Close cleans up and terminates any open connections. Close() error }
Source is a source for end devices.
Click to show internal directories.
Click to hide internal directories.