diff --git a/common/commands/doc.go b/common/commands/doc.go new file mode 100644 index 0000000..f6290ab --- /dev/null +++ b/common/commands/doc.go @@ -0,0 +1,7 @@ +/* +Package commands provides types and utility functions that are used for +interfacing with the JSON based command infrastructure in Ceph. + +The *rados.Conn type implements many of the interfaces found in this package. +*/ +package commands diff --git a/common/commands/interfaces.go b/common/commands/interfaces.go new file mode 100644 index 0000000..c6350b7 --- /dev/null +++ b/common/commands/interfaces.go @@ -0,0 +1,20 @@ +package commands + +// MgrCommander in an interface for the API needed to execute JSON formatted +// commands on the ceph mgr. +type MgrCommander interface { + MgrCommand(buf [][]byte) ([]byte, string, error) +} + +// MonCommander is an interface for the API needed to execute JSON formatted +// commands on the ceph mon(s). +type MonCommander interface { + MonCommand(buf []byte) ([]byte, string, error) +} + +// RadosCommander provides an interface for APIs needed to execute JSON +// formatted commands on the Ceph cluster. +type RadosCommander interface { + MgrCommander + MonCommander +}