users

package
v0.0.0-...-b378643 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusActive = "active"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivetUser

type PrivetUser struct {
	ID          int64  `json:"id"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Email       string `json:"email"`
	DateCreated string `json:"date_created"`
	Status      string `json:"status"`
}

type PublicUser

type PublicUser struct {
	ID          int64  `json:"user_id"`
	DateCreated string `json:"date_created"`
	Status      string `json:"status"`
}

type User

type User struct {
	ID          int64  `json:"id"`
	FirstName   string `json:"first_name"`
	LastName    string `json:"last_name"`
	Email       string `json:"email"`
	DateCreated string `json:"date_created"`
	Status      string `json:"status"`
	Password    string `json:"password"`
}

User : user type

func (*User) Delete

func (user *User) Delete() *errors.RestErr

Delete : Method to delete user

func (*User) FindByStatus

func (user *User) FindByStatus(status string) ([]User, *errors.RestErr)

func (*User) Get

func (user *User) Get() *errors.RestErr

Get : Method to get user by id

func (*User) Marshall

func (user *User) Marshall(isPublic bool) interface{}

func (*User) Save

func (user *User) Save() *errors.RestErr

Save : Method to create new user

func (*User) Update

func (user *User) Update() *errors.RestErr

Update : Method to update existing user

func (*User) Validate

func (user *User) Validate() *errors.RestErr

Validate : user method to validate persistence data

type Users

type Users []User

func (Users) Marshall

func (users Users) Marshall(isPublic bool) []interface{}

Jump to

Keyboard shortcuts

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