Skip to content

Commit e8e1d72

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
common commands: add new sub-package for common interface types
Add new common interface types for working with Ceph's "JSON commands" to a public sub-package. Signed-off-by: John Mulligan <[email protected]>
1 parent 8e4b834 commit e8e1d72

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Diff for: common/commands/doc.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
Package commands provides types and utility functions that are used for
3+
interfacing with the JSON based command infrastructure in Ceph.
4+
5+
The *rados.Conn type implements many of the interfaces found in this package.
6+
*/
7+
package commands

Diff for: common/commands/interfaces.go

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package commands
2+
3+
// MgrCommander in an interface for the API needed to execute JSON formatted
4+
// commands on the ceph mgr.
5+
type MgrCommander interface {
6+
MgrCommand(buf [][]byte) ([]byte, string, error)
7+
}
8+
9+
// MonCommander is an interface for the API needed to execute JSON formatted
10+
// commands on the ceph mon(s).
11+
type MonCommander interface {
12+
MonCommand(buf []byte) ([]byte, string, error)
13+
}
14+
15+
// RadosCommander provides an interface for APIs needed to execute JSON
16+
// formatted commands on the Ceph cluster.
17+
type RadosCommander interface {
18+
MgrCommander
19+
MonCommander
20+
}

0 commit comments

Comments
 (0)