common

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS                         = "SUCCESS"
	FAIL                            = "FAIL"
	CONFIG_PENDING                  = "CONFIG_PENDING"
	INVALID_PARAMETERS              = "INVALID_PARAMETERS"
	RESOURCE_NOT_FOUND              = "RESOURCE_NOT_FOUND"
	RESOURCE_ALREADY_EXIST          = "RESOURCE_ALREADY_EXIST"
	PARAMETER_ILLEGAL               = "PARAMETER_ILLEGAL"
	INVALID_POST_DATA               = "INVALID_POST_DATA"
	SERVER_ERROR                    = "SERVER_ERROR"
	RESOURCE_NUM_EXCEEDED           = "RESOURCE_NUM_EXCEEDED"
	SELECTED_RESOURCES_NUM_EXCEEDED = "SELECTED_RESOURCES_NUM_EXCEEDED"
	SERVICE_UNAVAILABLE             = "SERVICE_UNAVAILABLE"
	GET_ORG_DB_FAIL                 = "GET_ORG_DB_FAIL"
	K8S_SET_VTAP_FAIL               = "K8S_SET_VTAP_FAIL"
	ORG_ID_INVALID                  = "ORG_ID_INVALID"
	CHECK_SCOPE_TEAMS_FAIL          = "CHECK_SCOPE_TEAMS_FAIL"
	SET_RESOUORCE_FAIL              = "SET_RESOUORCE_FAIL"
	NO_PERMISSIONS                  = "NO_PERMISSIONS"

	// http status codes
	STATUES_PARTIAL_CONTENT = "STATUES_PARTIAL_CONTENT" // 206
)

Variables

View Source
var (
	ERR_NO_PERMISSIONS    = errors.New("NO_PERMISSIONS")
	ERR_FPERMIT_EXCEPTION = errors.New("FPERMIT_EXCEPTION")
)
View Source
var (
	ErrorFail    = errors.New("FAIL")
	ErrorPending = errors.New("PENDING")
)

Functions

func GetUnauthorizedTeamIDs

func GetUnauthorizedTeamIDs(userInfo *UserInfo, fpermitCfg *common.FPermit) (map[int]struct{}, error)

Types

type UserInfo

type UserInfo struct {
	Type         int
	ID           int
	ORGID        int
	DatabaseName string
}

func GetUserInfo

func GetUserInfo(c *gin.Context) *UserInfo

func NewUserInfo

func NewUserInfo(userType, userID, orgID int) *UserInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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