dashbutton

package module
v0.0.0-...-d156a5f Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2016 License: MIT Imports: 5 Imported by: 0

README

GoDoc MIT license

go-dash-button

Detect Amazon Dash Button Clicks for the Go programming language

License

MIT

See full license on mooyoul.mit-license.org

Documentation

Overview

package dashbutton allows users of dashbutton to detect dashbutton clicks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	HardwareAddr net.HardwareAddr
	IP           net.IP
}

Device contains network information of dash button.

type Interceptor

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

Interceptor sniff arp packets on specified network.

func NewInterceptor

func NewInterceptor(iface *net.Interface) (*Interceptor, error)

New interceptor

func (*Interceptor) Add

func (i *Interceptor) Add(dash net.HardwareAddr)

Add hardware address of dashbutton into watch group to detect clicks.

func (*Interceptor) Clicks

func (i *Interceptor) Clicks() <-chan Device

Start loop and return channel which produces Device on click

func (*Interceptor) Close

func (i *Interceptor) Close()

Close pcap handle and channels. loop will be stopped.

func (*Interceptor) Remove

func (i *Interceptor) Remove(dash net.HardwareAddr)

Remove hardware address of dashbutton from watch group.

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

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