Documentation ¶
Index ¶
- type AddNodeToRoleRequest
- type AddUserToRoleRequest
- type AddUserToSpaceRequest
- type Config
- type CreateNodeRequest
- type CreateNodeResponse
- type CreateRoleRequest
- type CreateSpaceRequest
- type CreateUserRequest
- type GetUserResponse
- type GrantCertRequest
- type GrantCertResponse
- type Guard
- type ListNodeRequest
- type ListNodeResponse
- type ListNodeVO
- type ListRoleNodeRequest
- type ListRoleNodeResponse
- type ListRoleRequest
- type ListRoleResponse
- type ListRoleUserRequest
- type ListRoleUserResponse
- type ListRoleVO
- type ListSpaceResponse
- type ListSpaceVO
- type ListUserRequest
- type ListUserResponse
- type Node
- type PageRequest
- type PrincipalList
- type Principals
- type RemoveNodeFromRoleRequest
- type RemoveUserFromRoleRequest
- type RoleNodeListRequest
- type RoleNodeListVO
- type RoleNodeRequest
- type RoleUserListVO
- type UpdateUserPublicKeyRequest
- type UserListVO
- type UserVO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddNodeToRoleRequest ¶
type AddNodeToRoleRequest struct { RoleID int64 `json:"role_id"` // Nodes is the node list, at least one node is required Nodes RoleNodeListRequest `json:"nodes"` }
func (*AddNodeToRoleRequest) Validate ¶
func (ar *AddNodeToRoleRequest) Validate() error
type AddUserToRoleRequest ¶
type AddUserToRoleRequest struct { // UserIDs is the user id list, at least one user id is required UserIDs []int64 `json:"user_ids"` RoleID int64 `json:"-"` }
func (*AddUserToRoleRequest) Validate ¶
func (aur *AddUserToRoleRequest) Validate() error
type AddUserToSpaceRequest ¶
type AddUserToSpaceRequest struct { SpaceID int64 `json:"-"` // UserIDs is the user id list, at // least one user id is required UserIDs []int64 `json:"user_ids"` }
func (*AddUserToSpaceRequest) Validate ¶
func (a *AddUserToSpaceRequest) Validate() error
type Config ¶
type CreateNodeRequest ¶
type CreateNodeRequest struct { SpaceID int64 `json:"-"` // Name is the name of the node Name string `json:"name"` Description string `json:"description"` // IP is the ip address of the node IP string `json:"ip"` // Accounts is the account list of the node, it should // is account from the machine. If it is empty, the default // account is root. Accounts []string `json:"accounts"` }
func (*CreateNodeRequest) Validate ¶
func (cnr *CreateNodeRequest) Validate() error
type CreateNodeResponse ¶
type CreateRoleRequest ¶
type CreateRoleRequest struct { SpaceID int64 `json:"-"` Name string `json:"name"` Description string `json:"description"` }
==== Role ====
func (*CreateRoleRequest) Validate ¶
func (crr *CreateRoleRequest) Validate() error
type CreateSpaceRequest ¶
type CreateSpaceRequest struct { Name string `json:"name"` Description string `json:"description"` }
==== Space ====
func (*CreateSpaceRequest) Validate ¶
func (cs *CreateSpaceRequest) Validate() error
type CreateUserRequest ¶
type CreateUserRequest struct { Username string `json:"username"` Email string `json:"email"` // PublicKey is the public key of the ssh key PublicKey string `json:"public_key"` }
==== User ====
func (*CreateUserRequest) Validate ¶
func (cur *CreateUserRequest) Validate() error
type GetUserResponse ¶
type GetUserResponse UserVO
type GrantCertRequest ¶
type GrantCertRequest struct { UserID int64 `json:"-"` // Effect in seconds Effect int64 `json:"effect"` // StartDate is the start time of the certificate // If it is 0, it means the current time StartDate int64 `json:"start_date"` }
func (*GrantCertRequest) Validate ¶
func (scr *GrantCertRequest) Validate() error
type GrantCertResponse ¶
type GrantCertResponse struct { // Cert is the certificate content Cert string `json:"cert"` }
type Guard ¶
type Guard interface { GetCA(ctx context.Context) []byte GetPrincipals(ctx context.Context, uniqueID string) (PrincipalList, error) GetNodeByUniqueID(ctx context.Context, uniqueID string) (*Node, error) GetKRL(ctx context.Context, uniqueID string) (string, error) GetAuthorizedKeys(ctx context.Context, uniqueID string) ([]string, error) CreateUser(ctx context.Context, in *CreateUserRequest) (int64, error) ListUser(ctx context.Context, in *ListUserRequest) (ListUserResponse, error) GetUser(ctx context.Context, id int64) (*GetUserResponse, error) GetUserByEmail(ctx context.Context, email string) (*GetUserResponse, error) BanUser(ctx context.Context, id int64) error UpdateUserPublicKey(ctx context.Context, in *UpdateUserPublicKeyRequest) error GrantCert(ctx context.Context, in *GrantCertRequest) (*GrantCertResponse, error) CreateSpace(ctx context.Context, in *CreateSpaceRequest) (int64, error) ListSpace(ctx context.Context) (ListSpaceResponse, error) CreateNode(ctx context.Context, in *CreateNodeRequest) (*CreateNodeResponse, error) ListNode(ctx context.Context, in *ListNodeRequest) (*ListNodeResponse, error) DeleteNode(ctx context.Context, id int64) error UpdateLastHeartbeat(ctx context.Context, uniqueID string) error CreateRole(ctx context.Context, in *CreateRoleRequest) (int64, error) ListRole(ctx context.Context, in *ListRoleRequest) (ListRoleResponse, error) DeleteRole(ctx context.Context, roleID int64) error AddNodeToRole(ctx context.Context, in *AddNodeToRoleRequest) error ListRoleNode(ctx context.Context, in *ListRoleNodeRequest) (ListRoleNodeResponse, error) RemoveNodeFromRole(ctx context.Context, in *RemoveNodeFromRoleRequest) error AddUserToRole(ctx context.Context, in *AddUserToRoleRequest) error ListRoleUser(ctx context.Context, in *ListRoleUserRequest) (ListRoleUserResponse, error) RemoveUserFromRole(ctx context.Context, in *RemoveUserFromRoleRequest) error }
type ListNodeRequest ¶
type ListNodeRequest struct { PageRequest SpaceID int64 `json:"-"` }
func (*ListNodeRequest) Validate ¶
func (lnr *ListNodeRequest) Validate() error
type ListNodeResponse ¶
type ListNodeResponse struct { Total int64 `json:"total"` Nodes []*ListNodeVO `json:"nodes"` }
type ListNodeVO ¶
type ListRoleNodeRequest ¶
type ListRoleNodeRequest struct {
RoleID int64 `json:"role_id"`
}
ListRoleNodeRequest list role node request
func (*ListRoleNodeRequest) Validate ¶
func (lrnr *ListRoleNodeRequest) Validate() error
type ListRoleNodeResponse ¶
type ListRoleNodeResponse []*RoleNodeListVO
type ListRoleRequest ¶
type ListRoleRequest struct {
SpaceID int64 `json:"space_id"`
}
func (*ListRoleRequest) Validate ¶
func (lrr *ListRoleRequest) Validate() error
type ListRoleResponse ¶
type ListRoleResponse []*ListRoleVO
type ListRoleUserRequest ¶
type ListRoleUserRequest struct {
RoleID int64 `json:"role_id"`
}
func (*ListRoleUserRequest) Validate ¶
func (lrur *ListRoleUserRequest) Validate() error
type ListRoleUserResponse ¶
type ListRoleUserResponse []*RoleUserListVO
type ListRoleVO ¶
type ListSpaceResponse ¶
type ListSpaceResponse []*ListSpaceVO
type ListSpaceVO ¶
type ListUserRequest ¶
type ListUserRequest struct {
PageRequest
}
type ListUserResponse ¶
type ListUserResponse []*UserListVO
type Node ¶
type Node struct { ID int64 `json:"id"` UniqueID string `json:"unique_id"` Secret string `json:"secret"` Name string `json:"name"` Description string `json:"description"` SpaceID int64 `json:"space_id"` IP string `json:"ip"` LastHeartbeat int64 `json:"last_heartbeat"` Accounts []string `json:"accounts"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type PageRequest ¶
type PageRequest struct { // Page is the page number, start from 1 Page int64 `form:"page"` // Limit is the number of items per page, // must be less than or equal to 1000 Limit int64 `form:"limit"` }
func (*PageRequest) Offset ¶
func (pr *PageRequest) Offset() int64
func (*PageRequest) Validate ¶
func (pr *PageRequest) Validate() error
type PrincipalList ¶
type PrincipalList = dto.PrincipalList
type Principals ¶
type Principals = dto.Principals
type RemoveNodeFromRoleRequest ¶
func (*RemoveNodeFromRoleRequest) Validate ¶
func (rnfr *RemoveNodeFromRoleRequest) Validate() error
type RemoveUserFromRoleRequest ¶
func (*RemoveUserFromRoleRequest) Validate ¶
func (rur *RemoveUserFromRoleRequest) Validate() error
type RoleNodeListRequest ¶
type RoleNodeListRequest []RoleNodeRequest
type RoleNodeListVO ¶
type RoleNodeRequest ¶
type RoleNodeRequest struct { // NodeID is the node id, one of node id and unique id is required // If both are provided, the node id is used NodeID int64 `json:"node_id"` // UniqueID is the unique id of the node UniqueID string `json:"unique_id"` // Account is the account of the node, must from the node account list Account string `json:"account"` }
type RoleUserListVO ¶
type UpdateUserPublicKeyRequest ¶
type UpdateUserPublicKeyRequest struct { UserID int64 `json:"user_id"` PublicKey string `json:"public_key"` }
func (*UpdateUserPublicKeyRequest) Validate ¶
func (uupr *UpdateUserPublicKeyRequest) Validate() error
type UserListVO ¶
Click to show internal directories.
Click to hide internal directories.