Documentation ¶
Index ¶
- func GetPTPProfileName(ptpConfig string) string
- type PTP4lConfig
- func (ptp4lCfg *PTP4lConfig) ByInterface(iface string) (PTPInterface, error)
- func (ptp4lCfg *PTP4lConfig) ByPortID(id int) (PTPInterface, error)
- func (ptp4lCfg *PTP4lConfig) ByRole(role types.PtpPortRole) (PTPInterface, error)
- func (ptp4lCfg *PTP4lConfig) GetAliasByInterface(p PTPInterface) string
- func (ptp4lCfg *PTP4lConfig) GetUnknownAlias() (string, error)
- func (ptp4lCfg *PTP4lConfig) String() string
- type PTPInterface
- type PtpConfigUpdate
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPTPProfileName ¶
GetPTPProfileName ... get profile name from ptpconfig
Types ¶
type PTP4lConfig ¶
type PTP4lConfig struct { Name string Profile string Interfaces []*PTPInterface }
PTP4lConfig ... get filename, profile name and interfaces
func (*PTP4lConfig) ByInterface ¶
func (ptp4lCfg *PTP4lConfig) ByInterface(iface string) (PTPInterface, error)
ByInterface ... get interface object by interface name
func (*PTP4lConfig) ByPortID ¶
func (ptp4lCfg *PTP4lConfig) ByPortID(id int) (PTPInterface, error)
ByPortID ... get ptp interface by port id
func (*PTP4lConfig) ByRole ¶
func (ptp4lCfg *PTP4lConfig) ByRole(role types.PtpPortRole) (PTPInterface, error)
ByRole ... get interface name by ptp port role
func (*PTP4lConfig) GetAliasByInterface ¶
func (ptp4lCfg *PTP4lConfig) GetAliasByInterface(p PTPInterface) string
GetAliasByInterface ... get alias name by interface name
func (*PTP4lConfig) GetUnknownAlias ¶
func (ptp4lCfg *PTP4lConfig) GetUnknownAlias() (string, error)
GetUnknownAlias ... when master port details are not know, get first interface alias name
func (*PTP4lConfig) String ¶
func (ptp4lCfg *PTP4lConfig) String() string
type PTPInterface ¶
type PTPInterface struct { Name string PortID int PortName string Role types.PtpPortRole }
PTPInterface ... ptp interfaces from ptpConfig
func (*PTPInterface) UpdateRole ¶
func (pi *PTPInterface) UpdateRole(role types.PtpPortRole)
UpdateRole ... update role
type PtpConfigUpdate ¶
type PtpConfigUpdate struct { Name *string `json:"name,omitempty"` Ptp4lConf *string `json:"ptp4lConf,omitempty"` Profile *string `json:"profile,omitempty"` Removed bool `json:"removed,omitempty"` }
PtpConfigUpdate ... updated ptp config values
func (*PtpConfigUpdate) GetAllInterface ¶
func (p *PtpConfigUpdate) GetAllInterface() []*string
GetAllInterface ... return interfaces
func (*PtpConfigUpdate) String ¶
func (p *PtpConfigUpdate) String() string
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher monitors a file for changes
func NewPtp4lConfigWatcher ¶
func NewPtp4lConfigWatcher(dirToWatch string, updatedConfig chan<- *PtpConfigUpdate) (w *Watcher, err error)
NewPtp4lConfigWatcher ... create new ptp4l config file watcher