Documentation ¶
Overview ¶
Package group provides operations to manage edge device group (e.g., create, join, leave, delete...).
Index ¶
- Constants
- type Command
- type Executor
- func (Executor) CreateGroup(body string) (int, map[string]interface{}, error)
- func (Executor) DeleteGroup(groupId string) (int, map[string]interface{}, error)
- func (Executor) GetGroup(groupId string) (int, map[string]interface{}, error)
- func (Executor) GetGroups() (int, map[string]interface{}, error)
- func (Executor) JoinGroup(groupId string, body string) (int, map[string]interface{}, error)
- func (Executor) LeaveGroup(groupId string, body string) (int, map[string]interface{}, error)
Constants ¶
const ( AGENTS = "nodes" // used to indicate a list of nodes. GROUPS = "groups" // used to indicate a list of groups. GROUP_NAME = "name" // used to indicate a group name. )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { // CreateGroup inserts a new group to databases. CreateGroup(body string) (int, map[string]interface{}, error) // GetGroup returns the information of the group specified by groupId parameter. GetGroup(groupId string) (int, map[string]interface{}, error) // GetGroups returns a list of groups that is created on databases. GetGroups() (int, map[string]interface{}, error) // JoinGroup adds the node to a list of members. JoinGroup(groupId string, body string) (int, map[string]interface{}, error) // LeaveGroup removes the node from a list of members. LeaveGroup(groupId string, body string) (int, map[string]interface{}, error) // DeleteGroup deletes the group with a primary key matching the groupId argument. DeleteGroup(groupId string) (int, map[string]interface{}, error) }
type Executor ¶
type Executor struct{}
func (Executor) CreateGroup ¶
CreateGroup inserts a new group to databases. This function returns a unique id in case of success and an error otherwise.
func (Executor) DeleteGroup ¶
DeleteGroup deletes the group with a primary key matching the groupId argument. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.
func (Executor) GetGroup ¶
GetGroup returns the information of the group specified by groupId parameter. If response code represents success, returns information about the group. Otherwise, an appropriate error will be returned.
func (Executor) GetGroups ¶
GetGroups returns a list of groups that is created on databases. If response code represents success, returns a list of groups. Otherwise, an appropriate error will be returned.