user

package
v0.0.0-...-73ce370 Latest Latest
Warning

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

Go to latest
Published: May 14, 2017 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is throw when an user is not found
	ErrNotFound = errors.New("user not found")
	// ErrNil is throw when an user is nil
	ErrNil = errors.New("user is nil")
)

Functions

This section is empty.

Types

type User

type User struct {
	ID           int       `json:"-" gorm:"column:id; primary_key; not null"`
	PublicKeyDER []byte    `json:"-" gorm:"column:key_public_der; size:2000; not null"`
	FingerPrint  string    `json:"key_fingerprint" gorm:"column:key_fingerprint; size:51; not null"`
	DisplayName  string    `json:"display_name" gorm:"column:display_name; size:42" validator-update:"string=length:max|42"`
	Signup       time.Time `json:"signup" gorm:"column:signup; not null" sql:"DEFAULT:current_timestamp"`
	LoginFirst   time.Time `json:"login_first" gorm:"column:login_first; not null" sql:"DEFAULT:'1970-01-01 00:00:00'"`
	LoginLast    time.Time `json:"login_last" gorm:"column:login_last; not null" sql:"DEFAULT:'1970-01-01 00:00:00'"`
}

User is the modelisation of an user

func (*User) MarshalJSON

func (u *User) MarshalJSON() ([]byte, error)

MarshalJSON overload the default user json marshal to add fields useful for clients

func (*User) Repr

func (u *User) Repr() (string, error)

Repr return an uniq representation of a given user this function should nerver be used to find a user, only to differentiate it visually because of possible collision

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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