Documentation
¶
Overview ¶
Package timezone provides system timezone management via timedatectl.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Darwin ¶
type Darwin struct{}
Darwin implements the Provider interface for Darwin (macOS). All methods return ErrUnsupported as timedatectl timezone management is not available on macOS.
func NewDarwinProvider ¶
func NewDarwinProvider() *Darwin
NewDarwinProvider factory to create a new Darwin instance.
type Debian ¶
type Debian struct {
provider.FactsAware
// contains filtered or unexported fields
}
Debian implements the Provider interface for Debian-family systems using timedatectl for timezone management.
func NewDebianProvider ¶
NewDebianProvider factory to create a new Debian instance.
type Info ¶
type Info struct {
Timezone string `json:"timezone"`
UTCOffset string `json:"utc_offset,omitempty"`
}
Info represents the current timezone configuration.
type Linux ¶
type Linux struct{}
Linux implements the Provider interface for generic Linux. All methods return ErrUnsupported as this is a generic Linux stub.
func NewLinuxProvider ¶
func NewLinuxProvider() *Linux
NewLinuxProvider factory to create a new Linux instance.
type Provider ¶
type Provider interface {
// Get returns the current system timezone.
Get(ctx context.Context) (*Info, error)
// Update sets the system timezone. Idempotent.
Update(ctx context.Context, tz string) (*UpdateResult, error)
}
Provider implements the methods to manage the system timezone.
type UpdateResult ¶
type UpdateResult struct {
Timezone string `json:"timezone"`
Changed bool `json:"changed"`
Error string `json:"error,omitempty"`
}
UpdateResult represents the outcome of a timezone update.