user

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeResponse

func EncodeResponse(w http.ResponseWriter, code int, res interface{})

EncodeResponse ...

Types

type Controller

type Controller struct {
	Users []User
}

Controller ...

func (*Controller) CreateUser

func (c *Controller) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser ...

func (*Controller) DeleteUser

func (c *Controller) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser ...

func (*Controller) ListUsers

func (c *Controller) ListUsers(w http.ResponseWriter, r *http.Request)

ListUsers ...

func (*Controller) ReadUser

func (c *Controller) ReadUser(w http.ResponseWriter, r *http.Request)

ReadUser ...

func (*Controller) UpdateUser

func (c *Controller) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser ...

type Role

type Role string

Role ...

const (
	ROLEUSER  Role = "ROLE_USER"
	ROLEADMIN      = "ROLE_ADMIN"
)

User Roles

type User

type User struct {
	ID         string `json:"id"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	Fullname   string `json:"fullname"`
	Mobile     string `json:"mobile"`
	CreatedAt  int64  `json:"createdAt"`
	ModifiedAt int64  `json:"modifiedAt"`
	Blocked    bool   `json:"blocked"`
	Roles      []Role `json:"roles"`
	// contains filtered or unexported fields
}

User ...

Jump to

Keyboard shortcuts

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