group

package
v0.0.0-...-b0339d0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package group provides operations to manage edge device group (e.g., create, join, leave, delete...).

Index

Constants

View Source
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

func (Executor) CreateGroup(body string) (int, map[string]interface{}, error)

CreateGroup inserts a new group to databases. This function returns a unique id in case of success and an error otherwise.

func (Executor) DeleteGroup

func (Executor) DeleteGroup(groupId string) (int, map[string]interface{}, error)

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

func (Executor) GetGroup(groupId string) (int, map[string]interface{}, error)

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

func (Executor) GetGroups() (int, map[string]interface{}, error)

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.

func (Executor) JoinGroup

func (Executor) JoinGroup(groupId string, body string) (int, map[string]interface{}, error)

JoinGroup adds the node to a list of members. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.

func (Executor) LeaveGroup

func (Executor) LeaveGroup(groupId string, body string) (int, map[string]interface{}, error)

LeaveGroup removes the node from a list of members. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.

Directories

Path Synopsis
Package mock_group is a generated GoMock package.
Package mock_group is a generated GoMock package.

Jump to

Keyboard shortcuts

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