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
- type ManagerFormat
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 ¶
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 `prop:"access:rw"` NTPServer string `prop:"access:rw"` // dbusutil-gen: ignore-below // Use 24 hour format to display time Use24HourFormat bool `prop:"access:rw"` // DST offset DSTOffset int32 `prop:"access:rw"` // User added timezone list UserTimezones []string // weekday shows format WeekdayFormat int32 `prop:"access:rw"` // short date shows format ShortDateFormat int32 `prop:"access:rw"` // long date shows format LongDateFormat int32 `prop:"access:rw"` // short time shows format ShortTimeFormat int32 `prop:"access:rw"` // long time shows format LongTimeFormat int32 `prop:"access:rw"` WeekBegins int32 `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
func (*Manager) SetNTPServer ¶
func (*Manager) SetTime ¶
Set the system clock to the specified.
usec: pass a value of microseconds since 1 Jan 1970 UTC.
relative: if true, the passed usec value will be added to the current system time; if false, the current system time will be set to the passed usec value.
func (*Manager) SetTimezone ¶
Set the system time zone to the specified value. timezones you may parse from /usr/share/zoneinfo/zone.tab.
zone: pass a value like "Asia/Shanghai" to set the timezone.
type ManagerFormat ¶
type ManagerFormat struct { PropsMu sync.RWMutex // dsg config CurrencySymbol string `prop:"access:rw"` PositiveCurrencyFormat string `prop:"access:rw"` NegativeCurrencyFormat string `prop:"access:rw"` DecimalSymbol string `prop:"access:rw"` DigitGroupingSymbol string `prop:"access:rw"` DigitGrouping string `prop:"access:rw"` // contains filtered or unexported fields }
Manage format settings
func (*ManagerFormat) GetInterfaceName ¶
func (*ManagerFormat) GetInterfaceName() string