appUser

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package appUser has the User type and associated methods to create, modify and delete application users

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	Username     string    `json:"username"`
	MobileID     string    `json:"mobile_id"`
	Email        string    `json:"email"`
	FirstName    string    `json:"first_name"`
	LastName     string    `json:"last_name"`
	CreateUserID string    `json:"create_user_id"`
	CreateDate   time.Time `json:"create_date"`
	UpdateUserID string    `json:"update_user_id"`
	UpdateDate   time.Time `json:"update_date"`
}

User represents an application user. A user can access multiple systems. The User-Application relationship is kept elsewhere...

Example
package main

import (
	"fmt"

	"github.com/gilcrest/go-API-template/pkg/appUser"
)

func main() {

	usr := appUser.User{Username: "repoMan", MobileID: "(617) 302-7777", Email: "repoman@alwaysintense.com", FirstName: "Otto", LastName: "Maddox"}

	fmt.Println(usr.Username)
	fmt.Println(usr.MobileID)
	fmt.Println(usr.Email)
	fmt.Println(usr.FirstName)
	fmt.Println(usr.LastName)
}
Output:
repoMan
(617) 302-7777
repoman@alwaysintense.com
Otto
Maddox

func (*User) Create

func (u *User) Create(ctx context.Context, env *env.Env) (*sql.Tx, error)

Create performs business validations prior to writing to the db

Jump to

Keyboard shortcuts

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