domains

package
v0.0.0-...-37c8998 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Org

type Org struct {
	Id          int64  `json:"id" db:"id"`
	Name        string `json:"name" db:"name"`
	Code        string `json:"code" db:"code"`
	Description string `json:"description" db:"description"`
	Domain      string `json:"domain" db:"domain"`

	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}

func (Org) Verify

func (u Org) Verify() error

type User

type User struct {
	// User indetifier number
	Id int64 `json:"id" db:"id" example:"1"`
	// User first name
	FirstName string `json:"first_name" db:"first_name" example:"Dzung"`
	// User last name
	LastName string `json:"last_name" db:"last_name" example:"Tran"`
	// User last name
	Code      string     `json:"code" db:"code" example:"95a8d1aa-xxx-xxx-0c15d41"`
	Email     string     `json:"email" db:"email" example:"email@api.com"`
	Phone     string     `json:"phone" db:"phone" example:"+84 0986415xxxx"`
	Status    UserStatus `json:"status" db:"status" example:"active" enums:"active,deactivated,banned"`
	CreatedAt time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt time.Time  `json:"updated_at" db:"updated_at"`
}

User domain info @Description User account information

func (User) Verify

func (u User) Verify() error

type UserOrg

type UserOrg struct {
	Id        int64       `json:"id" db:"id"`
	UserId    int64       `json:"user_id" db:"user_id"`
	OrgId     int64       `json:"org_id" db:"org_id"`
	Role      UserOrgRole `json:"role" db:"role"`
	Status    UserStatus  `json:"status" db:"status"`
	CreatedAt time.Time   `json:"created_at" db:"created_at"`
	UpdatedAt time.Time   `json:"updated_at" db:"updated_at"`
}

type UserOrgRole

type UserOrgRole string
const (
	UserRoleOwner   UserOrgRole = "owner"
	UserRoleManager UserOrgRole = "manager"
	UserRoleEditor  UserOrgRole = "editor"
	UserRoleViewer  UserOrgRole = "viewer"
	UserRoleGuest   UserOrgRole = "guest"
)

type UserStatus

type UserStatus string
const (
	UserStatusActive      UserStatus = "active"
	UserStatusDeactivated UserStatus = "deactivated"
	UserStatusBanned      UserStatus = "banned"

	// user org
	UserStatusInvited UserStatus = "invited"
)

type UserWithRoles

type UserWithRoles struct {
	User
	OrgRole map[int64]string `json:"org_role"`
}

func (UserWithRoles) GetOrgIds

func (u UserWithRoles) GetOrgIds() []int64

Jump to

Keyboard shortcuts

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