presence

package module
v1.0.0-a2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 13 Imported by: 0

README

Presence

Home network presence detection daemon for IFTTT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Interval     time.Duration `yaml:"interval"`
	Interfaces   []string      `yaml:"interfaces"`
	MACAddresses []string      `yaml:"mac_addresses"`
	PingCount    uint          `yaml:"ping_count"`
	IFTTT        IFTTT         `yaml:"ifttt"`
}

func ParseConfig

func ParseConfig(name string, wNet wrap.Net) (*Config, error)

func ParseConfigWithContext

func ParseConfigWithContext(ctx context.Context, name string, wNet wrap.Net) (*Config, error)

type Detector

type Detector interface {
	Detect(ctx context.Context) error
	Config(config *Config)
	Client(client ifttt.Client)
}

func NewDetector

func NewDetector(config *Config, arp neighbors.ARP, client ifttt.Client) Detector

type Events

type Events struct {
	Present string `yaml:"present"`
	Absent  string `yaml:"absent"`
}

type IFTTT

type IFTTT struct {
	BaseURL string `yaml:"base_url"`
	Key     string `yaml:"key"`
	Events  Events `yaml:"events"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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