aliyun

package module
v0.0.0-...-9c81db6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxItems  for const
	MaxItems = 1000
)

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *config

DefaultConfig 返回默认配置

Types

type AddOrRemoveUserToGroupRequest

type AddOrRemoveUserToGroupRequest struct {
	GroupName string `json:"group_name"`
	UserName  string `json:"user_name"`
}

type Component

type Component struct {
	// contains filtered or unexported fields
}

Component for aliyun

func (*Component) AddUserToGroup

func (c *Component) AddUserToGroup(req AddOrRemoveUserToGroupRequest) error

AddUserToGroup 添加用户至用户组

func (*Component) CreateRamUser

func (c *Component) CreateRamUser(req SaveRamUserRequest) (*RamUserResponse, error)

CreateRamUser ...

func (*Component) DelRamUser

func (c *Component) DelRamUser(userName string) error

DelRamUser 删除用户前,需要保证用户不拥有任何权限且不属于任何用户组。

func (*Component) GetGroup

func (c *Component) GetGroup(groupName string) (*GroupInfo, error)

GetGroup 根据组名获取组信息

func (*Component) GetRamUser

func (c *Component) GetRamUser(userName string) (*RamUserResponse, error)

GetRamUser ...

func (*Component) ListGroups

func (c *Component) ListGroups() ([]*GroupInfo, error)

ListGroups 获取全部用户组

func (*Component) ListGroupsForUser

func (c *Component) ListGroupsForUser(userName string) ([]*GroupInfo, error)

ListGroupsForUser 查询用户所属的用户组

func (*Component) RemoveUserFromGroup

func (c *Component) RemoveUserFromGroup(req AddOrRemoveUserToGroupRequest) error

RemoveUserFromGroup 将用户从用户组移除

type Container

type Container struct {
	// contains filtered or unexported fields
}

func DefaultContainer

func DefaultContainer() *Container

func Load

func Load(key string) *Container

func (*Container) Build

func (c *Container) Build(options ...Option) *Component

type GroupInfo

type GroupInfo struct {
	DisplayName string `json:"display_name"`
	GroupName   string `json:"group_name"`
	GroupID     string `json:"group_id"`
	Comments    string `json:"comments"`
	JoinDate    string `json:"join_date"`
	UpdateDate  string `json:"update_date"`
	CreateDate  string `json:"create_date"`
}

type Option

type Option func(c *Container)

type RamUserInfo

type RamUserInfo struct {
	UserID            string `json:"user_id"`
	CreateDate        string `json:"create_date"`
	UpdateDate        string `json:"update_date"`
	UserPrincipalName string `json:"user_principal_name"`
	DisplayName       string `json:"display_name"`
	MobilePhone       string `json:"mobile_phone"`
	Email             string `json:"email"`
	Comments          string `json:"comments"`
	LastLoginDate     string `json:"last_login_date"`
}

type RamUserResponse

type RamUserResponse struct {
	RequestID string      `json:"request_id"`
	User      RamUserInfo `json:"user"`
}

type SaveRamUserRequest

type SaveRamUserRequest struct {
	UserName    string `json:"user_name"`
	DisplayName string `json:"display_name"`
	MobilePhone string `json:"mobile_phone"`
	Email       string `json:"email"`
	Comments    string `json:"comments"`
}

SaveRamUserRequest 具体注释参考: https://help.aliyun.com/document_detail/185726.html?spm=a2c4g.11186623.6.737.207d1f2fRXubtd

Jump to

Keyboard shortcuts

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