user

package
v3.0.27 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserInfo = "userInfo"
)

Variables

This section is empty.

Functions

func New

func New(config *viper.Viper, cache *redis.RedisClient) middleware.Object

Types

type Group added in v3.0.13

type Group struct {
	ID       string   `json:"id"`
	Name     string   `json:"name"`
	Children []*Group `json:"children"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) GetConfig

func (h *Handler) GetConfig() *viper.Viper

func (*Handler) Handle

func (h *Handler) Handle() gin.HandlerFunc

func (*Handler) SetConfig

func (h *Handler) SetConfig(config *viper.Viper)

type Permission

type Permission struct {
	ID        int64     `json:"id"`
	Name      string    `json:"name"`
	GuardName string    `json:"guardName"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Pivot     *Pivot    `json:"pivot"`
}

type Pivot

type Pivot struct {
	ModelID      int64  `json:"model_id,omitempty"`
	RoleID       int64  `json:"role_id,omitempty"`
	ModelType    string `json:"model_type,omitempty"`
	PermissionID int64  `json:"permission_id,omitempty"`
}

type Response

type Response struct {
	User *User `json:"user"`
}

type Role

type Role struct {
	ID       string  `json:"id"`
	Name     string  `json:"name"`
	Children []*Role `json:"children"`
}

type User

type User struct {
	ID     int64    `json:"id"`
	Roles  []*Role  `json:"roles"`
	Groups []*Group `json:"groups"`
}

func GetUser

func GetUser(c *gin.Context) (*User, error)

Jump to

Keyboard shortcuts

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