Documentation
¶
Index ¶
- type Daemon
- type Manager
- func (m *Manager) AddUserTimezone(zone string) *dbus.Error
- func (m *Manager) DeleteUserTimezone(zone string) *dbus.Error
- func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods
- func (*Manager) GetInterfaceName() string
- func (m *Manager) GetSampleNTPServers() (servers []string, busErr *dbus.Error)
- func (m *Manager) GetZoneInfo(zone string) (zoneInfo zoneinfo.ZoneInfo, busErr *dbus.Error)
- func (m *Manager) GetZoneList() (zoneList []string, busErr *dbus.Error)
- func (m *Manager) Reset() *dbus.Error
- func (m *Manager) SetDate(year, month, day, hour, min, sec, nsec int32) *dbus.Error
- func (m *Manager) SetLocalRTC(localRTC, fixSystem bool) *dbus.Error
- func (m *Manager) SetNTP(useNTP bool) *dbus.Error
- func (m *Manager) SetNTPServer(server string) *dbus.Error
- func (m *Manager) SetTime(usec int64, relative bool) *dbus.Error
- func (m *Manager) SetTimezone(zone string) *dbus.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
type Daemon struct { *loader.ModuleBase // contains filtered or unexported fields }
func (*Daemon) GetDependencies ¶
func (*Daemon) WaitEnable ¶
func (d *Daemon) WaitEnable()
type Manager ¶
type Manager struct { PropsMu sync.RWMutex // Whether can use NTP service CanNTP bool // Whether enable NTP service NTP bool // Whether set RTC to Local standard LocalRTC bool // Current timezone Timezone string NTPServer string // dbusutil-gen: ignore-below // Use 24 hour format to display time Use24HourFormat gsprop.Bool `prop:"access:rw"` // DST offset DSTOffset gsprop.Int `prop:"access:rw"` // User added timezone list UserTimezones gsprop.Strv // weekday shows format WeekdayFormat gsprop.Int `prop:"access:rw"` // short date shows format ShortDateFormat gsprop.Int `prop:"access:rw"` // long date shows format LongDateFormat gsprop.Int `prop:"access:rw"` // short time shows format ShortTimeFormat gsprop.Int `prop:"access:rw"` // long time shows format LongTimeFormat gsprop.Int `prop:"access:rw"` WeekBegins gsprop.Int `prop:"access:rw"` // contains filtered or unexported fields }
Manage time settings
func NewManager ¶
Create Manager, if create freedesktop timedate1 failed return error
func (*Manager) AddUserTimezone ¶
Add the specified time zone to user time zone list.
func (*Manager) DeleteUserTimezone ¶
Delete the specified time zone from user time zone list.
func (*Manager) GetExportedMethods ¶
func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods
func (*Manager) GetInterfaceName ¶
func (*Manager) GetSampleNTPServers ¶
func (*Manager) GetZoneInfo ¶
GetZoneInfo returns the information of the specified time zone.
func (*Manager) GetZoneList ¶
GetZoneList returns all the valid timezones.
func (*Manager) SetDate ¶
SetDate Set the system clock to the specified.
The time may be specified in the format '2015' '1' '1' '18' '18' '18' '8'.
func (*Manager) SetLocalRTC ¶
To control whether the RTC is the local time or UTC. Standards are divided into: localtime and UTC. UTC standard will automatically adjust the daylight saving time.
实时时间(RTC)是否使用 local 时间标准。时间标准分为 local 和 UTC。 UTC 时间标准会自动根据夏令时而调整系统时间。
localRTC: whether to use local time.
fixSystem: if true, will use the RTC time to adjust the system clock; if false, the system time is written to the RTC taking the new setting into account.
func (*Manager) SetNTP ¶
To control whether the system clock is synchronized with the network.
useNTP: if true, enable ntp; else disable