commands

package
v0.0.0-...-678448a Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2016 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package commands defines the command interfaces that need to be implemented by the GlusterD commands

Package commands implements rest end points for each commands.

GlusterD 2.0 uses [mux](github.com/gorilla/mux) which implements a request router and dispatcher. The name mux stands for "HTTP request multiplexer". Like the standard http.ServeMux, mux.Router matches incoming requests against a list of registered routes and calls a handler for the route that matches the URL or other conditions.

Route models a route to be set on the GlusterD Rest server and holds the name, pattern and the registered handler function. Group of mgmt commands like peers, volumes should define its route table and glusterd while initializing will iterate over all these router tables and register them. The handler function is the one which holds the logic of how the command is going to be executed.

Developers are expected to create directories for each group of commands under command folder in the codebase. Say for all peer related commands, commands/peers directory should exist. Inside commands/peers, a commands.go file should define all the ReST router details and respective handlers should be defined in inidividual .go file for every commands. dAlong with that individual commands must have an entry in the

Index

Constants

This section is empty.

Variables

View Source
var Commands = []Command{
	&versioncommands.Command{},
	&volumecommands.Command{},
	&peercommands.Command{},
}

Commands is a list of commands available

Functions

This section is empty.

Types

type Command

type Command interface {
	// Routes should return a table of REST API endpoints and handlers for the command
	Routes() rest.Routes
}

Command is the interface that needs to be implemented by the GlusterD commands

Directories

Path Synopsis
Package peercommands implements the peer management commands
Package peercommands implements the peer management commands
Package versioncommands implements the version command Package versioncommands implements the version ReST end point
Package versioncommands implements the version command Package versioncommands implements the version ReST end point
Package volumecommands implements the volume management commands
Package volumecommands implements the volume management commands

Jump to

Keyboard shortcuts

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