models

package
v0.0.0-...-f3a6a69 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddRoleReq

type AddRoleReq struct {
	Role          InternalRole             `json:"role"`
	PermissionIDs []InternalRolePermission `json:"permissions"`
}

type AuthenticatorResponse

type AuthenticatorResponse struct {
	*Token
	AuthID string
}

type GoogleAuthenticatedResponse

type GoogleAuthenticatedResponse struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

type InternalRole

type InternalRole struct {
	*Role
	Status constants.RoleStatus `json:"status" db:"status"`
}

type InternalRolePermission

type InternalRolePermission struct {
	RoleID       int64                          `json:"role_id" db:"role_id"`
	PermissionID int64                          `json:"permission_id" db:"permission_id"`
	Status       constants.RolePermissionStatus `json:"status" db:"status"`
}

type Permission

type Permission struct {
	ID     int64                      `json:"id,omitempty" db:"id"`
	Code   string                     `json:"code" db:"code"`
	Name   string                     `json:"name" db:"name"`
	RoleID int64                      `json:"-" db:"role_id"`
	Status constants.PermissionStatus `json:"status" db:"status"`
}

type RefreshToken

type RefreshToken struct {
	ID        int64                        `db:"id" json:"id"`
	UserID    int64                        `db:"user_id" json:"user_id"`
	Token     string                       `db:"token" json:"token"`
	Status    constants.RefreshTokenStatus `db:"status" json:"status"`
	ExpiresAt time.Time                    `db:"expires_at" json:"expires_at"`
}

type RegisterReq

type RegisterReq struct {
	AuthID          string `json:"username"`
	Password        string `json:"password"`
	ConfirmPassword string `json:"confirm_password"`
}

type Role

type Role struct {
	ID   int64  `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}

type RolePermission

type RolePermission struct {
	*Role
	Permissions []*Permission
}

type Token

type Token struct {
	AccessToken  string    `json:"access_token"`
	Expiry       time.Time `json:"expiry"`
	RefreshToken string    `json:"refresh_token"`
}

type User

type User struct {
	ID       int64                `json:"id" db:"id"`
	AuthID   string               `json:"auth_id" db:"auth_id"`
	Password []byte               `json:"-" db:"password"`
	Status   constants.UserStatus `json:"status" db:"status"`
}

type UserAccess

type UserAccess struct {
	RoleID int64                      `json:"role_id" db:"role_id"`
	UserID int64                      `json:"user_id" db:"user_id"`
	Name   string                     `json:"name" db:"name"`
	Status constants.UserAccessStatus `json:"status" db:"status"`
}

type UserToken

type UserToken struct {
	*User
	*Token
}

Jump to

Keyboard shortcuts

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