Documentation
¶
Overview ¶
SPDX-License-Identifier: Apache-2.0 Copyright © 2022 Roberto Hidalgo <nidito@un.rob.mx>
SPDX-License-Identifier: Apache-2.0 Copyright © 2022 Roberto Hidalgo <nidito@un.rob.mx>
SPDX-License-Identifier: Apache-2.0 Copyright © 2022 Roberto Hidalgo <nidito@un.rob.mx>
SPDX-License-Identifier: Apache-2.0 Copyright © 2022 Roberto Hidalgo <nidito@un.rob.mx>
SPDX-License-Identifier: Apache-2.0 Copyright © 2022 Roberto Hidalgo <nidito@un.rob.mx>
Index ¶
- Variables
- type Credential
- type Schedule
- type Subscription
- type TTL
- type UTCTime
- type User
- func (u *User) DeleteCredentials(sess db.Session) error
- func (user *User) Expired() bool
- func (u *User) FetchCredentials(sess db.Session) error
- func (user *User) HasCredentials() bool
- func (user *User) IsAllowed(t time.Time) error
- func (user *User) Login(password string) error
- func (u *User) MarshalJSON() ([]byte, error)
- func (u *User) Store(sess db.Session) db.Store
- func (o *User) UnmarshalJSON(b []byte) error
- func (u *User) WebAuthnCredentials() []webauthn.Credential
- func (u *User) WebAuthnDisplayName() string
- func (u *User) WebAuthnID() []byte
- func (u *User) WebAuthnIcon() string
- func (u *User) WebAuthnName() string
- type WPS
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTTL = TTL{/* contains filtered or unexported fields */}
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct { UserID int `db:"user"` Data string `db:"data"` // contains filtered or unexported fields }
func (*Credential) AsWebAuthn ¶
func (c *Credential) AsWebAuthn() webauthn.Credential
func (*Credential) Store ¶
func (c *Credential) Store(sess db.Session) db.Store
type Schedule ¶
type Schedule struct {
// contains filtered or unexported fields
}
func (Schedule) MarshalJSON ¶
func (*Schedule) UnmarshalJSON ¶
type Subscription ¶
func (*Subscription) AsWebPush ¶
func (s *Subscription) AsWebPush() *webpush.Subscription
func (*Subscription) ID ¶
func (s *Subscription) ID() string
func (*Subscription) Store ¶
func (s *Subscription) Store(sess db.Session) db.Store
type TTL ¶
type TTL struct {
// contains filtered or unexported fields
}
func (*TTL) MarshalJSON ¶
func (*TTL) UnmarshalJSON ¶
type UTCTime ¶
type UTCTime struct {
// contains filtered or unexported fields
}
func (*UTCTime) MarshalJSON ¶
func (*UTCTime) UnmarshalJSON ¶
type User ¶
type User struct { ID int `db:"id,omitempty" json:"-"` Expires *UTCTime `db:"expires,omitempty" json:"expires,omitempty"` Greeting string `db:"greeting" json:"greeting"` Handle string `db:"handle" json:"handle"` IsAdmin bool `db:"is_admin" json:"is_admin"` Name string `db:"name" json:"name"` Password string `db:"password" json:"password"` Require2FA bool `db:"second_factor" json:"second_factor"` Schedule *Schedule `db:"schedule,omitempty" json:"schedule,omitempty"` TTL *TTL `db:"max_ttl,omitempty" json:"max_ttl,omitempty"` IsNotified bool `db:"receives_notifications" json:"receives_notifications"` // contains filtered or unexported fields }
func FromContext ¶
func (*User) DeleteCredentials ¶
func (*User) FetchCredentials ¶
func (*User) HasCredentials ¶
func (*User) MarshalJSON ¶
func (*User) UnmarshalJSON ¶
func (*User) WebAuthnCredentials ¶
func (u *User) WebAuthnCredentials() []webauthn.Credential
Credentials owned by the user
func (*User) WebAuthnDisplayName ¶
Display Name of the user
func (*User) WebAuthnID ¶
func (*User) WebAuthnName ¶
User Name according to the Relying Party
type WPS ¶
type WPS struct {
*webpush.Subscription
}
func (WPS) MarshalJSON ¶
func (*WPS) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.