users

package
v0.0.0-...-9785764 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUserHandler

func CreateUserHandler() *httptransport.Server

CreateUserHandler will give you the UpdateUser service server

func DeleteUserHandler

func DeleteUserHandler() *httptransport.Server

DeleteUserHandler will give you the DeleteUser service server

func GetUserHandler

func GetUserHandler() *httptransport.Server

GetUserHandler will give you the GetUser service server

func UpdateUserHandler

func UpdateUserHandler() *httptransport.Server

UpdateUserHandler will give you the UpdateUser service server

Types

type CreateUserRequest

type CreateUserRequest struct {
	Username  string `json:"username"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Age       int    `json:"age"`
}

CreateUserRequest is the CreateUser request structure

type CreateUserResponse

type CreateUserResponse struct {
	ID int `json:"id"`
	CreateUserRequest
}

CreateUserResponse is the CreateUser response structure

type DeleteUserRequest

type DeleteUserRequest struct {
	ID string `json:"id"`
}

DeleteUserRequest is the DeleteUser service request structure

type DeleteUserResponse

type DeleteUserResponse struct {
	ID      string `json:"id"`
	Deleted bool   `json:"deleted"`
	Err     string `json:"error"`
}

DeleteUserResponse is the DeleteUser service response

type GetUserReqeust

type GetUserReqeust struct {
	ID string `json:"id"`
}

GetUserReqeust is the GetUser request structure

type GetUserResponse

type GetUserResponse struct {
	ID        string `json:"id"`
	Username  string `json:"username"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Age       int    `json:"age"`
}

GetUserResponse is the GetUser reponse structure

func NewGetUserResponse

func NewGetUserResponse(id, username, firstName, lastName string, age int) GetUserResponse

NewGetUserResponse is the GetUserResponse factory function

type Service

Service is the users microservice interface

type UpdateUserRequest

type UpdateUserRequest struct {
	ID        string `json:"id"`
	Username  string `json:"username"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Age       int    `json:"age"`
}

UpdateUserRequest is the UpdateUser request structure

type UpdateUserResponse

type UpdateUserResponse struct {
	UpdateUserRequest
}

UpdateUserResponse is the UpdateUser reponse strucutre

Jump to

Keyboard shortcuts

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