service

package
v0.0.0-...-f1366d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMacAddress

func CheckMacAddress(token string) error

CheckMacAddress validates an entered MAC address is valid for the device

Types

type Auth

type Auth struct {
	DataStore datastore.DataStore
}

Auth is the implementation of the authentication service

func NewAuthService

func NewAuthService(store datastore.DataStore) *Auth

NewAuthService creates a new authentication service

func (*Auth) CreateSession

func (auth *Auth) CreateSession(token string, expires time.Time) (*datastore.Session, error)

CreateSession creates a new session, validating the token

func (*Auth) ValidateSession

func (auth *Auth) ValidateSession(username, sessionID string) (*datastore.Session, error)

ValidateSession checks that the session is valid

type AuthService

type AuthService interface {
	ValidateSession(username, sessionID string) (*datastore.Session, error)
	CreateSession(token string, expires time.Time) (*datastore.Session, error)
}

AuthService is the interface for the authentication service

type Time

type Time struct {
	Timezones []string  `json:"timezones"`
	Timezone  string    `json:"timezone"`
	NTP       bool      `json:"ntp"`
	Time      time.Time `json:"time"`
	// contains filtered or unexported fields
}

Time implements actions for managing time

func NewTime

func NewTime(dBus dbus.Service) *Time

NewTime creates a time object from the device settings

func (*Time) Apply

func (t *Time) Apply(ntp bool, timezone, setTime string) error

Apply updates the time settings

func (*Time) Current

func (t *Time) Current() *Time

Current returns the current time settings

type TimeService

type TimeService interface {
	Current() *Time
	Apply(ntp bool, timezone, setTime string) error
}

TimeService is the interface for the timedatectl command

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL