models

package
v0.0.0-...-3efca3f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBInterface

type DBInterface interface {
}

type Email

type Email struct {
	Primary  bool   `json:"primary" bson:"primary"`   // only primary email is marked
	Email    string `json:"email" bson:"email"`       // email added to account
	Verified bool   `json:"verified" bson:"verified"` // is email address verified
}

type FileInterface

type FileInterface interface {
}

type User

type User struct {
	//BsonID          bson.ObjectId   `json:"_id" bson:"_id,omitempty"`                // user id generated
	ID              interface{} `json:"id" bson:"_id,omitempty"`                    // user id generated
	Username        string      `json:"username" bson:"username"`                   // username used to display
	Firstname       string      `json:"first_name" bson:"first_name"`               // first name of client
	Lastname        string      `json:"last_name" bson:"last_name"`                 // last name of client
	Emails          []Email     `json:"emails" bson:"emails"`                       // emails registered to client
	PasswordSalt    string      `json:"password_salt" bson:"password_salt"`         // salt of password
	PasswordHash    string      `json:"password_hash" bson:"password_hash"`         // hash of password
	Active          bool        `json:"active" bson:"active"`                       // is the account activated using the token
	ActivationToken string      `json:"activation_token" bson:"activation_token"`   // token to activate the accounts
	Tokens          []string    `json:"tokens" bson:"tokens"`                       // access tokens
	CollectionRoot  string      `json:"root" bson:"root"`                           // root directory of the collections
	StorageMaxByte  int64       `json:"storage_max_byte" bson:"storage_max_byte"`   // max storage allowed in Byte
	StorageUsedByte int64       `json:"storage_used_byte" bson:"storage_used_byte"` // actual storage used in Byte
}

func (*User) Id

func (u *User) Id() string

type UserInterface

type UserInterface interface {
	CreateUser(username, firstname, lastname, email, passwordSalt, passwordHash, activationToken string) error
	ActivateUser(id, token string) error
	AddToken(id string, tokens ...string) error
	GetByEmail(email string) (*User, error)
	GetByUsername(username string) (*User, error)
	GetByID(id string) (*User, error)
	SetStorageLimit(id string, byte int64) error
}

Jump to

Keyboard shortcuts

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