Documentation ¶
Index ¶
- Variables
- func NewTraceCommander(c ccom.RadosCommander) ccom.RadosCommander
- type NotImplementedError
- type Response
- func MarshalMgrCommand(m ccom.MgrCommander, v interface{}) Response
- func MarshalMonCommand(m ccom.MonCommander, v interface{}) Response
- func NewResponse(b []byte, s string, e error) Response
- func RawMgrCommand(m ccom.MgrCommander, buf []byte) Response
- func RawMonCommand(m ccom.MonCommander, buf []byte) Response
- func (r Response) Body() []byte
- func (r Response) EmptyBody() Response
- func (r Response) End() error
- func (r Response) Error() string
- func (r Response) FilterBodyPrefix(p string) Response
- func (r Response) FilterDeprecated() Response
- func (r Response) FilterPrefix(p string) Response
- func (r Response) FilterSuffix(s string) Response
- func (r Response) NoBody() Response
- func (r Response) NoData() Response
- func (r Response) NoStatus() Response
- func (r Response) Ok() bool
- func (r Response) Status() string
- func (r Response) Unmarshal(v interface{}) Response
- func (r Response) Unwrap() error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrStatusNotEmpty may be returned if a call should not have a status // string set but one is. ErrStatusNotEmpty = errors.New("response status not empty") // ErrBodyNotEmpty may be returned if a call should have an empty body but // a body value is present. ErrBodyNotEmpty = errors.New("response body not empty") )
Functions ¶
func NewTraceCommander ¶
func NewTraceCommander(c ccom.RadosCommander) ccom.RadosCommander
NewTraceCommander is a RadosCommander that wraps a given RadosCommander and when commands are executes prints debug level "traces" to the standard output.
Types ¶
type NotImplementedError ¶
type NotImplementedError struct {
Response
}
NotImplementedError error values will be returned in the case that an API call is not available in the version of Ceph that is running in the target cluster.
func (NotImplementedError) Error ¶
func (e NotImplementedError) Error() string
Error implements the error interface.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response encapsulates the data returned by ceph and supports easy processing pipelines.
func MarshalMgrCommand ¶
func MarshalMgrCommand(m ccom.MgrCommander, v interface{}) Response
MarshalMgrCommand takes an generic interface{} value, converts it to JSON and sends the json to the MGR as a command.
func MarshalMonCommand ¶
func MarshalMonCommand(m ccom.MonCommander, v interface{}) Response
MarshalMonCommand takes an generic interface{} value, converts it to JSON and sends the json to the MGR as a command.
func NewResponse ¶
NewResponse returns a response.
func RawMgrCommand ¶
func RawMgrCommand(m ccom.MgrCommander, buf []byte) Response
RawMgrCommand takes a byte buffer and sends it to the MGR as a command. The buffer is expected to contain preformatted JSON.
func RawMonCommand ¶
func RawMonCommand(m ccom.MonCommander, buf []byte) Response
RawMonCommand takes a byte buffer and sends it to the MON as a command. The buffer is expected to contain preformatted JSON.
func (Response) EmptyBody ¶ added in v0.11.0
EmptyBody is similar to NoBody but also accepts an empty JSON object.
func (Response) End ¶
End returns an error if the response contains an error or nil, indicating that response is no longer needed for processing.
func (Response) FilterBodyPrefix ¶ added in v0.15.0
FilterBodyPrefix sets the body value equivalent to an empty string if the body value contains the given prefix string.
func (Response) FilterDeprecated ¶
FilterDeprecated removes deprecation warnings from the response status. Use it when checking the response from calls that may be deprecated in ceph if you want those calls to continue working if the warning is present.
func (Response) FilterPrefix ¶
FilterPrefix sets the status value to an empty string if the status value contains the given prefix string.
func (Response) FilterSuffix ¶
FilterSuffix sets the status value to an empty string if the status value contains the given suffix string.