userAPI

package
Version: v0.0.0-...-29dd356 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MyUsers = []User{
	{
		ID:        1,
		Firstname: "Gerasimos",
		Lastname:  "Maropoulos",
	},
	{
		ID:        2,
		Firstname: "Hillary",
		Lastname:  "Clinton",
	},
	{
		ID:        3,
		Firstname: "Donald",
		Lastname:  "Trump",
	},
}

MyUsers is our fake users database/store

Functions

func DeleteByID

func DeleteByID(ctx *iris.Context)

DeleteByID removes a user from 'myUsers' by ID

func GetAll

func GetAll(ctx *iris.Context)

GetAll returns all users as "application/json"

func GetByID

func GetByID(ctx *iris.Context)

GetByID returns a user by ID as "application/json"

func Insert

func Insert(ctx *iris.Context)

Insert adds a new user to 'myUsers'

func Update

func Update(ctx *iris.Context)

Update updates a user by path param ID this may not work but you get the point

Types

type User

type User struct {
	ID        int
	Firstname string
	Lastname  string
}

User is just a test User representation

Source Files

Jump to

Keyboard shortcuts

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