model

package
v0.0.0-...-8ca9a05 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	Context context.Context
	Client  *datastore.Client
}

func New

func New() *Datastore

func (*Datastore) CreateEmail

func (d *Datastore) CreateEmail(address, verificationCodeID, userID string, verified, preferred bool) (Email, *rerror.Error)

func (*Datastore) CreateKeyPair

func (d *Datastore) CreateKeyPair(name, userID string, verificationCodeID string, verified bool, days int32) (KeyPair, *datastore.Key, *rerror.Error)

func (*Datastore) CreateSession

func (d *Datastore) CreateSession(userAgent, ip, userID, verificationCodeID string) (Session, *datastore.Key, *rerror.Error)

func (*Datastore) CreateUser

func (d *Datastore) CreateUser(fullName, alias string) (User, *datastore.Key, *rerror.Error)

func (*Datastore) CreateVerificationCode

func (d *Datastore) CreateVerificationCode() (VerificationCode, *datastore.Key, *rerror.Error)

func (*Datastore) ExtendSession

func (d *Datastore) ExtendSession(sessionID string) (Session, *datastore.Key, *rerror.Error)

func (*Datastore) ExtendUserExpiration

func (d *Datastore) ExtendUserExpiration(userID string) *rerror.Error

func (*Datastore) GetEmailBy

func (d *Datastore) GetEmailBy(field, value string, keysOnly bool) (Email, *datastore.Key, *rerror.Error)

func (*Datastore) GetEmailsByUserID

func (d *Datastore) GetEmailsByUserID(userID string, verified bool, preferred bool, keysOnly bool) ([]Email, []*datastore.Key, *rerror.Error)

func (*Datastore) GetKeyPairBy

func (d *Datastore) GetKeyPairBy(field, value string, keysOnly bool) (KeyPair, *datastore.Key, *rerror.Error)

func (*Datastore) GetKeyPairByKeyAndSecret

func (d *Datastore) GetKeyPairByKeyAndSecret(key, secret string, valid, keysOnly bool) (KeyPair, *datastore.Key, *rerror.Error)

func (*Datastore) GetSessionBy

func (d *Datastore) GetSessionBy(field, value string, valid, keysOnly bool) (Session, *datastore.Key, *rerror.Error)

func (*Datastore) GetUserBy

func (d *Datastore) GetUserBy(field, value string, enabled bool) (User, *datastore.Key, *rerror.Error)

func (*Datastore) GetVerificationCodeByID

func (d *Datastore) GetVerificationCodeByID(verificationCodeID string, valid, keysOnly bool) (VerificationCode, *datastore.Key, *rerror.Error)

func (*Datastore) SetPreferredEmail

func (d *Datastore) SetPreferredEmail(userID, emailID string) *rerror.Error

func (*Datastore) VerifyEmail

func (d *Datastore) VerifyEmail(verificationCodeID string) *rerror.Error

func (*Datastore) VerifyKeyPair

func (d *Datastore) VerifyKeyPair(verificationCodeID string) *rerror.Error

func (*Datastore) VerifySession

func (d *Datastore) VerifySession(verificationCodeID string) *rerror.Error

type Email

type Email struct {
	ID                 string
	UserID             string
	VerificationCodeID string
	CreatedAt          time.Time
	UpdatedAt          time.Time
	Address            string
	Verified           bool
	Preferred          bool
}

type KeyPair

type KeyPair struct {
	ID                 string
	UserID             string
	VerificationCodeID string
	CreatedAt          time.Time
	UpdatedAt          time.Time
	ExpireAt           time.Time
	Name               string
	Key                string
	Secret             string
	Verified           bool
}

type Session

type Session struct {
	ID                 string
	UserID             string
	VerificationCodeID string
	CreatedAt          time.Time
	UpdatedAt          time.Time
	ExpireAt           time.Time
	Bearer             string
	UserAgent          string
	IP                 string
	Verified           bool
}

type User

type User struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
	ExpireAt  time.Time
	FullName  string
	Alias     string
	Enabled   bool
	Verified  bool
	Roles     []string
}

type VerificationCode

type VerificationCode struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
	ExpireAt  time.Time
	Code      string
}

Jump to

Keyboard shortcuts

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