Documentation ¶
Index ¶
- Constants
- func AddResToRoleIfNotExist(ec miso.Rail, req AddRoleResReq, user common.User) error
- func AddResToRoleIfNotExistEp(c *gin.Context, ec miso.Rail, req AddRoleResReq) (any, error)
- func AddRole(ec miso.Rail, req AddRoleReq, user common.User) error
- func AddRoleEp(c *gin.Context, ec miso.Rail, req AddRoleReq) (any, error)
- func BindPathRes(rail miso.Rail, req BindPathResReq) error
- func BindPathResEp(c *gin.Context, ec miso.Rail, req BindPathResReq) (any, error)
- func BootstrapServer(args []string)
- func CreateMonitoredServiceWatch(rail miso.Rail, m MonitoredService) error
- func CreateMonitoredServiceWatches(rail miso.Rail) error
- func CreatePathIfNotExist(rail miso.Rail, req CreatePathReq, user common.User) error
- func CreateResourceIfNotExist(rail miso.Rail, req CreateResReq, user common.User) error
- func CreateResourceIfNotExistEp(c *gin.Context, ec miso.Rail, req CreateResReq) (any, error)
- func DeletePath(ec miso.Rail, req DeletePathReq) error
- func DeletePathEp(c *gin.Context, ec miso.Rail, req DeletePathReq) (any, error)
- func DeleteResource(ec miso.Rail, req DeleteResourceReq) error
- func DeleteResourceEp(c *gin.Context, ec miso.Rail, req DeleteResourceReq) (any, error)
- func GetRoleInfoEp(c *gin.Context, ec miso.Rail, req RoleInfoReq) (any, error)
- func ListAllResBriefsEp(c *gin.Context, ec miso.Rail) (any, error)
- func ListAllResBriefsOfRoleEp(c *gin.Context, ec miso.Rail) (any, error)
- func ListAllRoleBriefsEp(c *gin.Context, ec miso.Rail) (any, error)
- func ListPathsEp(c *gin.Context, ec miso.Rail, req ListPathReq) (any, error)
- func ListResourceCandidatesForRoleEp(c *gin.Context, ec miso.Rail) (any, error)
- func ListResourcesEp(c *gin.Context, ec miso.Rail, req ListResReq) (any, error)
- func ListRoleResEp(c *gin.Context, ec miso.Rail, req ListRoleResReq) (any, error)
- func ListRolesEp(c *gin.Context, ec miso.Rail, req ListRoleReq) (any, error)
- func ListenAddPathEvent(rail miso.Rail, req CreatePathReq) error
- func ListenAddResourceEvent(rail miso.Rail, req CreateResReq) error
- func LoadPathResCache(rail miso.Rail) error
- func LoadResCodeCache(rail miso.Rail) error
- func LoadRoleResCache(ec miso.Rail) error
- func QueryResourcePathAsync(rail miso.Rail, server miso.Server, m MonitoredService)
- func RegisterInternalPathResourcesOnBootstrapped()
- func RegisterWebEndpoints(rail miso.Rail) error
- func RemoveResFromRole(ec miso.Rail, req RemoveRoleResReq) error
- func RemoveResFromRoleEp(c *gin.Context, ec miso.Rail, req RemoveRoleResReq) (any, error)
- func ScheduleTasks(rail miso.Rail) error
- func SubEventBus(rail miso.Rail) error
- func TriggerResourcePathCollection(rail miso.Rail, m MonitoredService)
- func UnbindPathRes(ec miso.Rail, req UnbindPathResReq) error
- func UnbindPathResEp(c *gin.Context, ec miso.Rail, req UnbindPathResReq) (any, error)
- func UpdatePath(ec miso.Rail, req UpdatePathReq) error
- func UpdatePathEp(c *gin.Context, ec miso.Rail, req UpdatePathReq) (any, error)
- type AddRoleReq
- type AddRoleResReq
- type BindPathResReq
- type CachedUrlRes
- type CreatePathReq
- type CreateResReq
- type DeletePathReq
- type DeleteResourceReq
- type EPath
- type ERes
- type ERole
- type ERoleRes
- type ExtendedPathRes
- type GenResScriptReq
- type ListPathReq
- type ListPathResp
- type ListResReq
- type ListResResp
- type ListRoleReq
- type ListRoleResReq
- type ListRoleResResp
- type ListRoleResp
- type ListedRoleRes
- type MonitorConf
- type MonitoredService
- type PathDoc
- type PathRes
- type PathType
- type QueryResourcePathRes
- type RemoveRoleResReq
- type ResBrief
- type RoleBrief
- type RoleInfoReq
- type RoleInfoResp
- type TestResAccessReq
- type TestResAccessResp
- type UnbindPathResReq
- type UpdatePathReq
- type WPath
- type WRes
- type WRole
Constants ¶
View Source
const (
DefaultMonitorPath = "/auth/resource"
)
View Source
const (
ErrCodeRoleNotFound = "GA0001"
)
View Source
const (
ResourceManageResources = "manage-resources"
)
Variables ¶
This section is empty.
Functions ¶
func AddResToRoleIfNotExist ¶
func BindPathRes ¶
func BindPathRes(rail miso.Rail, req BindPathResReq) error
func BindPathResEp ¶
func BootstrapServer ¶
func BootstrapServer(args []string)
func CreateMonitoredServiceWatch ¶
func CreateMonitoredServiceWatch(rail miso.Rail, m MonitoredService) error
func CreatePathIfNotExist ¶
func DeletePath ¶
func DeletePath(ec miso.Rail, req DeletePathReq) error
func DeletePathEp ¶
func DeleteResource ¶
func DeleteResource(ec miso.Rail, req DeleteResourceReq) error
func DeleteResourceEp ¶
func GetRoleInfoEp ¶
func ListPathsEp ¶
func ListResourcesEp ¶
func ListRoleResEp ¶
func ListRolesEp ¶
func ListenAddPathEvent ¶
func ListenAddPathEvent(rail miso.Rail, req CreatePathReq) error
func ListenAddResourceEvent ¶
func ListenAddResourceEvent(rail miso.Rail, req CreateResReq) error
func QueryResourcePathAsync ¶
func QueryResourcePathAsync(rail miso.Rail, server miso.Server, m MonitoredService)
func RegisterInternalPathResourcesOnBootstrapped ¶
func RegisterInternalPathResourcesOnBootstrapped()
func RegisterWebEndpoints ¶
func RemoveResFromRole ¶
func RemoveResFromRole(ec miso.Rail, req RemoveRoleResReq) error
func RemoveResFromRoleEp ¶
func ScheduleTasks ¶
func SubEventBus ¶
func TriggerResourcePathCollection ¶
func TriggerResourcePathCollection(rail miso.Rail, m MonitoredService)
func UnbindPathRes ¶
func UnbindPathRes(ec miso.Rail, req UnbindPathResReq) error
func UnbindPathResEp ¶
func UpdatePath ¶
func UpdatePath(ec miso.Rail, req UpdatePathReq) error
func UpdatePathEp ¶
Types ¶
type AddRoleReq ¶
type AddRoleReq struct {
Name string `json:"name" validation:"notEmpty,maxLen:32"` // role name
}
type AddRoleResReq ¶
type BindPathResReq ¶
type CachedUrlRes ¶
type CreatePathReq ¶
type CreatePathReq struct { Type PathType `json:"type" validation:"notEmpty"` Url string `json:"url" validation:"notEmpty,maxLen:128"` Group string `json:"group" validation:"notEmpty,maxLen:20"` Method string `json:"method" validation:"notEmpty,maxLen:10"` Desc string `json:"desc" validation:"maxLen:255"` ResCode string `json:"resCode"` }
type CreateResReq ¶
type DeletePathReq ¶
type DeletePathReq struct {
PathNo string `json:"pathNo" validation:"notEmpty"`
}
type DeleteResourceReq ¶
type DeleteResourceReq struct {
ResCode string `json:"resCode" validation:"notEmpty"`
}
type ExtendedPathRes ¶
type ExtendedPathRes struct { Id int // id Pgroup string // path group PathNo string // path no ResCode string // resource code Desc string // description Url string // url Method string // http method Ptype PathType // path type: PROTECTED, PUBLIC CreateTime miso.ETime CreateBy string UpdateTime miso.ETime UpdateBy string }
type GenResScriptReq ¶
type GenResScriptReq struct {
ResCodes []string `json:"resCodes" validation:"notEmpty"`
}
type ListPathReq ¶
type ListPathResp ¶
func ListPaths ¶
func ListPaths(ec miso.Rail, req ListPathReq) (ListPathResp, error)
type ListResReq ¶
type ListResResp ¶
func ListResources ¶
func ListResources(ec miso.Rail, req ListResReq) (ListResResp, error)
type ListRoleReq ¶
type ListRoleResReq ¶
type ListRoleResResp ¶
type ListRoleResResp struct { Paging miso.Paging `json:"pagingVo"` Payload []ListedRoleRes `json:"payload"` }
func ListRoleRes ¶
func ListRoleRes(ec miso.Rail, req ListRoleResReq) (ListRoleResResp, error)
type ListRoleResp ¶
func ListRoles ¶
func ListRoles(ec miso.Rail, req ListRoleReq) (ListRoleResp, error)
type ListedRoleRes ¶
type MonitorConf ¶
type MonitorConf struct {
Monitor []MonitoredService
}
type MonitoredService ¶
func LoadMonitoredServices ¶
func LoadMonitoredServices() []MonitoredService
type QueryResourcePathRes ¶
type QueryResourcePathRes struct { Resources []CreateResReq Paths []CreatePathReq }
func QueryResourcePath ¶
type RemoveRoleResReq ¶
type ResBrief ¶
func ListAllResBriefsOfRole ¶
type RoleInfoReq ¶
type RoleInfoReq struct {
RoleNo string `json:"roleNo" validation:"notEmpty"`
}
type RoleInfoResp ¶
func GetRoleInfo ¶
func GetRoleInfo(ec miso.Rail, req RoleInfoReq) (RoleInfoResp, error)
type TestResAccessReq ¶
type TestResAccessResp ¶
type TestResAccessResp struct {
Valid bool `json:"valid"`
}
func TestResourceAccess ¶
func TestResourceAccess(ec miso.Rail, req TestResAccessReq) (TestResAccessResp, error)
Test access to resource
type UnbindPathResReq ¶
type UpdatePathReq ¶
type WPath ¶
type WPath struct { Id int `json:"id"` Pgroup string `json:"pgroup"` PathNo string `json:"pathNo"` Method string `json:"method"` Desc string `json:"desc"` Url string `json:"url"` Ptype PathType `json:"ptype"` CreateTime miso.ETime `json:"createTime"` CreateBy string `json:"createBy"` UpdateTime miso.ETime `json:"updateTime"` UpdateBy string `json:"updateBy"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.