Documentation ¶
Index ¶
- Constants
- Variables
- func ChannelIs5GHz(channel uint32) bool
- type Channel
- type Config
- type Node
- type YanicDB
- func (conn *YanicDB) Close()
- func (conn *YanicDB) InsertGlobals(stats *runtimeYanic.GlobalStats, time time.Time, site string, domain string)
- func (conn *YanicDB) InsertLink(link *runtimeYanic.Link, time time.Time)
- func (conn *YanicDB) InsertNode(n *runtimeYanic.Node)
- func (conn *YanicDB) PruneNodes(deleteAfter time.Duration)
Constants ¶
View Source
const (
FREQ_THREASHOLD = 5000
)
View Source
const LOCATION_EQUAL_FORMAT_STRING = "%.6f"
Variables ¶
View Source
var ( ChannelEU = true ChannelList = map[uint32]*Channel{ 1: &Channel{Frequenz: 2412, AllowedInEU: true, DFS: false, Indoor: false, SDR: false}, 5: &Channel{Frequenz: 2432, AllowedInEU: true, DFS: false, Indoor: false, SDR: false}, 9: &Channel{Frequenz: 2452, AllowedInEU: true, DFS: false, Indoor: false, SDR: false}, 13: &Channel{Frequenz: 2472, AllowedInEU: true, DFS: false, Indoor: false, SDR: false}, 34: &Channel{Frequenz: 5170, AllowedInEU: false, DFS: false, Indoor: true, SDR: false}, 36: &Channel{Frequenz: 5180, AllowedInEU: true, DFS: false, Indoor: true, SDR: false}, 38: &Channel{Frequenz: 5190, AllowedInEU: false, DFS: false, Indoor: true, SDR: false}, 42: &Channel{Frequenz: 5210, AllowedInEU: false, DFS: false, Indoor: true, SDR: false}, 44: &Channel{Frequenz: 5220, AllowedInEU: true, DFS: false, Indoor: true, SDR: false}, 46: &Channel{Frequenz: 5230, AllowedInEU: false, DFS: false, Indoor: true, SDR: false}, 52: &Channel{Frequenz: 5260, AllowedInEU: true, DFS: true, Indoor: true, SDR: false}, 54: &Channel{Frequenz: 5270, AllowedInEU: false, DFS: true, Indoor: true, SDR: false}, 58: &Channel{Frequenz: 5290, AllowedInEU: false, DFS: true, Indoor: true, SDR: false}, 60: &Channel{Frequenz: 5300, AllowedInEU: true, DFS: true, Indoor: true, SDR: false}, 62: &Channel{Frequenz: 5310, AllowedInEU: false, DFS: true, Indoor: true, SDR: false}, 68: &Channel{Frequenz: 5340, AllowedInEU: true, DFS: true, Indoor: true, SDR: false}, 96: &Channel{Frequenz: 5480, AllowedInEU: true, DFS: true, Indoor: false, SDR: false}, 100: &Channel{Frequenz: 5500, AllowedInEU: true, DFS: true, Indoor: false, SDR: false}, 102: &Channel{Frequenz: 5510, AllowedInEU: false, DFS: true, Indoor: false, SDR: false}, 106: &Channel{Frequenz: 5530, AllowedInEU: false, DFS: true, Indoor: false, SDR: false}, 108: &Channel{Frequenz: 5540, AllowedInEU: true, DFS: true, Indoor: false, SDR: false}, 110: &Channel{Frequenz: 5550, AllowedInEU: false, DFS: true, Indoor: false, SDR: false}, 114: &Channel{Frequenz: 5570, AllowedInEU: true, DFS: true, Indoor: false, SDR: false}, 134: &Channel{Frequenz: 5670, AllowedInEU: false, DFS: true, Indoor: false, SDR: false}, 138: &Channel{Frequenz: 5690, AllowedInEU: false, DFS: true, Indoor: false, SDR: false}, } )
Functions ¶
func ChannelIs5GHz ¶
Types ¶
type Channel ¶
func GetChannel ¶
type Config ¶
type Config struct { // prevent crashes DatabaseType string `toml:"db_type"` DatabaseConnection string `toml:"db_connection"` // address on which the api and static content webserver runs WebserverBind string `toml:"webserver_bind"` // path to deliver static content Webroot string `toml:"webroot"` // auth secret Secret string `toml:"secret"` // SSH private key SSHPrivateKey string `toml:"ssh_key"` SSHIPAddressSuffix string `toml:"ssh_ipaddress_suffix"` SSHTimeout duration.Duration `toml:"ssh_timeout"` // yanic socket YanicEnable bool `toml:"yanic_enable"` YanicSynchronize duration.Duration `toml:"yanic_synchronize"` YanicCollectInterval duration.Duration `toml:"yanic_collect_interval"` Yanic respondYanic.InterfaceConfig `toml:"yanic"` }
config file of this daemon (for more the config_example.conf in git repository)
type Node ¶
type Node struct { Lastseen jsontime.Time `json:"lastseen" mapstructure:"-"` NodeID string `json:"node_id" gorm:"primary_key" mapstructure:"node_id"` Hostname string `json:"hostname"` Location yanicData.Location `json:"location" gorm:"embedded;embedded_prefix:location_"` Wireless yanicData.Wireless `json:"wireless" gorm:"embedded;embedded_prefix:wireless_"` Owner string `json:"owner"` Blacklist bool `json:"blacklist" gorm:"-" mapstructure:"-"` Address string `json:"ip" mapstructure:"-"` Stats struct { Wireless yanicData.WirelessStatistics `json:"wireless"` Clients yanicData.Clients `json:"clients"` } `json:"statistics" mapstructure:"-"` }
func (*Node) GetAddress ¶
func (*Node) Update ¶
func (n *Node) Update(node *yanicRuntime.Node)
type YanicDB ¶
type YanicDB struct { databaseYanic.Connection // contains filtered or unexported fields }
func NewYanicDB ¶
func NewYanicDB(db *gorm.DB, ssh *ssh.Manager, sendNode func(*Node, bool), sendStats func(*runtimeYanic.GlobalStats), prefix string) *YanicDB
func (*YanicDB) InsertGlobals ¶
func (conn *YanicDB) InsertGlobals(stats *runtimeYanic.GlobalStats, time time.Time, site string, domain string)
func (*YanicDB) InsertLink ¶
func (conn *YanicDB) InsertLink(link *runtimeYanic.Link, time time.Time)
func (*YanicDB) InsertNode ¶
func (conn *YanicDB) InsertNode(n *runtimeYanic.Node)
func (*YanicDB) PruneNodes ¶
Click to show internal directories.
Click to hide internal directories.