authority

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorityNodeStateEnabled  = 1 // 已启用
	AuthorityNodeStateDisabled = 0 // 已禁用
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorityKey

type AuthorityKey struct {
	Id           uint32   `field:"id"`           // ID
	Value        string   `field:"value"`        // Key值
	DayFrom      string   `field:"dayFrom"`      // 开始日期
	DayTo        string   `field:"dayTo"`        // 结束日期
	Hostname     string   `field:"hostname"`     // Hostname
	MacAddresses dbs.JSON `field:"macAddresses"` // MAC地址
	UpdatedAt    uint64   `field:"updatedAt"`    // 创建/修改时间
	Company      string   `field:"company"`      // 公司组织
}

AuthorityKey 企业版认证信息

type AuthorityKeyDAO

type AuthorityKeyDAO dbs.DAO
var SharedAuthorityKeyDAO *AuthorityKeyDAO

func NewAuthorityKeyDAO

func NewAuthorityKeyDAO() *AuthorityKeyDAO

func (*AuthorityKeyDAO) IsPlus

func (this *AuthorityKeyDAO) IsPlus(tx *dbs.Tx) (bool, error)

IsPlus 判断是否为企业版

type AuthorityKeyOperator

type AuthorityKeyOperator struct {
	Id           interface{} // ID
	Value        interface{} // Key值
	DayFrom      interface{} // 开始日期
	DayTo        interface{} // 结束日期
	Hostname     interface{} // Hostname
	MacAddresses interface{} // MAC地址
	UpdatedAt    interface{} // 创建/修改时间
	Company      interface{} // 公司组织
}

func NewAuthorityKeyOperator

func NewAuthorityKeyOperator() *AuthorityKeyOperator

type AuthorityNode

type AuthorityNode struct {
	Id          uint32   `field:"id"`          // ID
	IsOn        bool     `field:"isOn"`        // 是否启用
	UniqueId    string   `field:"uniqueId"`    // 唯一ID
	Secret      string   `field:"secret"`      // 密钥
	Name        string   `field:"name"`        // 名称
	Description string   `field:"description"` // 描述
	Order       uint32   `field:"order"`       // 排序
	State       uint8    `field:"state"`       // 状态
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	AdminId     uint32   `field:"adminId"`     // 管理员ID
	Weight      uint32   `field:"weight"`      // 权重
	Status      dbs.JSON `field:"status"`      // 运行状态
}

AuthorityNode 监控节点

type AuthorityNodeDAO

type AuthorityNodeDAO dbs.DAO
var SharedAuthorityNodeDAO *AuthorityNodeDAO

func NewAuthorityNodeDAO

func NewAuthorityNodeDAO() *AuthorityNodeDAO

func (*AuthorityNodeDAO) CountAllEnabledAuthorityNodes

func (this *AuthorityNodeDAO) CountAllEnabledAuthorityNodes(tx *dbs.Tx) (int64, error)

CountAllEnabledAuthorityNodes 计算认证节点数量

func (*AuthorityNodeDAO) CountAllLowerVersionNodes

func (this *AuthorityNodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error)

CountAllLowerVersionNodes 计算所有节点中低于某个版本的节点数量

func (*AuthorityNodeDAO) CreateAuthorityNode

func (this *AuthorityNodeDAO) CreateAuthorityNode(tx *dbs.Tx, name string, description string, isOn bool) (nodeId int64, err error)

CreateAuthorityNode 创建认证节点

func (*AuthorityNodeDAO) DisableAuthorityNode

func (this *AuthorityNodeDAO) DisableAuthorityNode(tx *dbs.Tx, id int64) error

DisableAuthorityNode 禁用条目

func (*AuthorityNodeDAO) EnableAuthorityNode

func (this *AuthorityNodeDAO) EnableAuthorityNode(tx *dbs.Tx, id int64) error

EnableAuthorityNode 启用条目

func (*AuthorityNodeDAO) FindAllEnabledAuthorityNodes

func (this *AuthorityNodeDAO) FindAllEnabledAuthorityNodes(tx *dbs.Tx) (result []*AuthorityNode, err error)

FindAllEnabledAuthorityNodes 列出所有可用认证节点

func (*AuthorityNodeDAO) FindAuthorityNodeName

func (this *AuthorityNodeDAO) FindAuthorityNodeName(tx *dbs.Tx, id int64) (string, error)

FindAuthorityNodeName 根据主键查找名称

func (*AuthorityNodeDAO) FindEnabledAuthorityNode

func (this *AuthorityNodeDAO) FindEnabledAuthorityNode(tx *dbs.Tx, id int64) (*AuthorityNode, error)

FindEnabledAuthorityNode 查找启用中的条目

func (*AuthorityNodeDAO) FindEnabledAuthorityNodeIdWithUniqueId

func (this *AuthorityNodeDAO) FindEnabledAuthorityNodeIdWithUniqueId(tx *dbs.Tx, uniqueId string) (int64, error)

FindEnabledAuthorityNodeIdWithUniqueId 根据唯一ID获取节点ID

func (*AuthorityNodeDAO) FindEnabledAuthorityNodeWithUniqueId

func (this *AuthorityNodeDAO) FindEnabledAuthorityNodeWithUniqueId(tx *dbs.Tx, uniqueId string) (*AuthorityNode, error)

FindEnabledAuthorityNodeWithUniqueId 根据唯一ID获取节点信息

func (*AuthorityNodeDAO) GenUniqueId

func (this *AuthorityNodeDAO) GenUniqueId(tx *dbs.Tx) (string, error)

GenUniqueId 生成唯一ID

func (*AuthorityNodeDAO) ListEnabledAuthorityNodes

func (this *AuthorityNodeDAO) ListEnabledAuthorityNodes(tx *dbs.Tx, offset int64, size int64) (result []*AuthorityNode, err error)

ListEnabledAuthorityNodes 列出单页的认证节点

func (*AuthorityNodeDAO) UpdateAuthorityNode

func (this *AuthorityNodeDAO) UpdateAuthorityNode(tx *dbs.Tx, nodeId int64, name string, description string, isOn bool) error

UpdateAuthorityNode 修改认证节点

func (*AuthorityNodeDAO) UpdateNodeStatus

func (this *AuthorityNodeDAO) UpdateNodeStatus(tx *dbs.Tx, nodeId int64, nodeStatus *nodeconfigs.NodeStatus) error

UpdateNodeStatus 更改节点状态

type AuthorityNodeOperator

type AuthorityNodeOperator struct {
	Id          interface{} // ID
	IsOn        interface{} // 是否启用
	UniqueId    interface{} // 唯一ID
	Secret      interface{} // 密钥
	Name        interface{} // 名称
	Description interface{} // 描述
	Order       interface{} // 排序
	State       interface{} // 状态
	CreatedAt   interface{} // 创建时间
	AdminId     interface{} // 管理员ID
	Weight      interface{} // 权重
	Status      interface{} // 运行状态
}

func NewAuthorityNodeOperator

func NewAuthorityNodeOperator() *AuthorityNodeOperator

Jump to

Keyboard shortcuts

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