models

package
v0.0.0-...-1e22bb6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateUser

func UpdateUser(username string, fields bson.M) bool

Types

type User

type User struct {
	Id          primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	UserId      uint64             `json:"id,omitempty" bson:"id, omitempty"`
	Username    string             `json:"username,omitempty" bson:"username, omitempty"`
	DisplayName string             `json:"displayname,omitempty" bson:"displayname,omitempty`
	Icon        string             `json:"icon,omitempty" bson:"icon,omitempty`
	PublicKey   string             `json:"publickey,omitempty", bson:"publickey,omitempty"`
	// Challenge string             `json:"challenge,omitempty" bson:"challenge,omitempty"`
	// SessionData      webauthn.SessionData `json:"sessionData,omitempty" bson:"sessionData,omitempty"`
	Credentials []webauthn.Credential `json:"credentials" bson:"credentials"`
}

func AddUser

func AddUser(username string) (User, error)

func GetNewUser

func GetNewUser() User

func GetUser

func GetUser(username string) (User, error)

func GetUserOrCreate

func GetUserOrCreate(username string) (User, error)

func NewUser

func NewUser(username string) User

WebAuthnCredentials webauthn.Credential

func (*User) AddCredential

func (u *User) AddCredential(credential webauthn.Credential)

AddCredential associates the credential to the user

func (User) WebAuthnCredentials

func (u User) WebAuthnCredentials() []webauthn.Credential

func (User) WebAuthnDisplayName

func (u User) WebAuthnDisplayName() string

func (User) WebAuthnID

func (u User) WebAuthnID() []byte

func (User) WebAuthnIcon

func (u User) WebAuthnIcon() string

func (User) WebAuthnName

func (u User) WebAuthnName() string

Jump to

Keyboard shortcuts

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