Documentation ¶
Overview ¶
@Time : 2019-08-27 14:57 @Author : zr
Index ¶
- type Memory
- func (m *Memory) DeleteRole(name string) (err error)
- func (m *Memory) DeleteService(name string) (err error)
- func (m *Memory) NewRole(name string, description string) (r *Role, err error)
- func (m *Memory) NewService(servicePath, description string) (service *Service, err error)
- func (m *Memory) RoleUpdateServices(roleName string, servicePaths ...string) (err error)
- func (m *Memory) Sync()
- type Role
- type Service
- type Status
- type Storage
- type User
- type UserRole
- type UserStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memory ¶ added in v1.1.0
type Memory struct { Services map[string]*Service Roles map[string]*Role sync.Mutex SyncErr error // contains filtered or unexported fields }
func (*Memory) DeleteRole ¶ added in v1.1.0
func (*Memory) DeleteService ¶ added in v1.1.0
func (*Memory) NewService ¶ added in v1.1.0
func (*Memory) RoleUpdateServices ¶ added in v1.1.0
type Role ¶
type Role struct { Name string Description string EditTime time.Time CreateTime time.Time Status Status Services []*Service `gorm:"-"` // contains filtered or unexported fields }
func (*Role) SetDescription ¶ added in v1.1.0
func (*Role) SetServices ¶ added in v1.1.0
type Service ¶
type Service struct { Path string Description string CreateTime time.Time EditTime time.Time Status Status // contains filtered or unexported fields }
func (*Service) NewSubService ¶
func (*Service) SetDescription ¶ added in v1.1.0
type Storage ¶
type Storage interface { Sync(memory *Memory) (err error) RoleUpdate(role *Role) error RoleCreate(role *Role) (err error) RoleDelete(name string) (err error) ServiceUpdate(service *Service) (err error) ServiceCreate(service *Service) (err error) ServiceDelete(name string) (err error) UpdateRelation(role *Role, service []*Service) error }
type User ¶ added in v1.1.0
type UserStatus ¶ added in v1.1.0
type UserStatus int
const ( UserStatusBan UserStatus = -1 UserStatusNormal UserStatus )
Click to show internal directories.
Click to hide internal directories.