domains

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyObject

func VerifyObject(o interface{}) error

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 {
	Id        int64      `json:"id" db:"id"`
	FirstName string     `json:"first_name" db:"first_name"`
	LastName  string     `json:"last_name" db:"last_name"`
	Code      string     `json:"code" db:"code"`
	Email     string     `json:"email" db:"email"`
	Phone     string     `json:"phone" db:"phone"`
	Status    UserStatus `json:"status" db:"status"`
	CreatedAt time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt time.Time  `json:"updated_at" db:"updated_at"`
}

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

type Verifiable

type Verifiable interface {
	Verify() error
}

Jump to

Keyboard shortcuts

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