Documentation ¶
Index ¶
- type Array
- type Caller
- type Client
- type Dispatcher
- func (d *Dispatcher) Dispatch(methodName string, args *Value) (*Value, error)
- func (d *Dispatcher) Handle(name string, m Method)
- func (d *Dispatcher) HandleFunc(name string, f func(*Value) (*Value, error))
- func (d *Dispatcher) HandleUnknownFunc(f func(string, *Value) (*Value, error))
- func (d *Dispatcher) SystemMethods()
- type Handler
- type Member
- type Method
- type MethodCall
- type MethodError
- type MethodFunc
- type MethodResponse
- type Param
- type Params
- type Query
- func (q *Query) Any() interface{}
- func (q *Query) Bool() bool
- func (q *Query) Err() error
- func (q *Query) Float64() float64
- func (q *Query) Idx(i int) *Query
- func (q *Query) Int() (i int)
- func (q *Query) IsEmpty() bool
- func (q *Query) IsNotEmpty() bool
- func (q *Query) Key(name string) *Query
- func (q *Query) Map() map[string]*Query
- func (q *Query) Slice() []*Query
- func (q *Query) String() string
- func (q *Query) Strings() []string
- func (q *Query) TryKey(name string) *Query
- func (q *Query) Value() *Value
- type Struct
- type Value
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Data []*Value `xml:"data>value"`
}
Array represents an XML-RPC array.
type Dispatcher ¶ added in v0.1.2
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher dispatches an XML-RPC call to a registered function.
func (*Dispatcher) Dispatch ¶ added in v0.1.2
func (d *Dispatcher) Dispatch(methodName string, args *Value) (*Value, error)
Dispatch dispatches a method call to a registered function.
func (*Dispatcher) Handle ¶ added in v0.1.2
func (d *Dispatcher) Handle(name string, m Method)
Handle registers a Method.
func (*Dispatcher) HandleFunc ¶ added in v0.1.2
func (d *Dispatcher) HandleFunc(name string, f func(*Value) (*Value, error))
HandleFunc registers an ordinary function as Method.
func (*Dispatcher) HandleUnknownFunc ¶ added in v0.1.2
func (d *Dispatcher) HandleUnknownFunc(f func(string, *Value) (*Value, error))
HandleUnknownFunc registers an ordinary function to handle unknown methods names.
func (*Dispatcher) SystemMethods ¶ added in v0.1.2
func (d *Dispatcher) SystemMethods()
SystemMethods adds system.multicall and system.listMethods.
type Handler ¶
type Handler struct { RequestSizeLimit int64 *Dispatcher }
Handler implements a http.Handler which can handle XML-RPC requests. Remote calls are dispatched to the registered Method's.
type MethodCall ¶
type MethodCall struct { MethodName string `xml:"methodName"` Params *Params `xml:"params"` XMLName xml.Name `xml:"methodCall"` }
MethodCall represents an XML-RPC method call.
type MethodError ¶
MethodError encapsulates an XML-RPC fault response.
func (*MethodError) Error ¶
func (f *MethodError) Error() string
Error implements the error interface.
type MethodFunc ¶
MethodFunc is an adapter to use ordinary functions as Method's.
type MethodResponse ¶
type MethodResponse struct { Params *Params `xml:"params"` Fault *Value `xml:"fault>value"` XMLName xml.Name `xml:"methodResponse"` }
MethodResponse represents an XML-RPC method response.
type Params ¶
type Params struct {
Param []*Param `xml:"param"`
}
Params holds the parameters for the method call or response.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query helps to extract values from the XML model.
func (*Query) Any ¶
func (q *Query) Any() interface{}
Any returns data type int, bool, float64, string or nil for an empty optional.
func (*Query) IsEmpty ¶
IsEmpty returns true, if there is no previous error and the value is empty. An empty value can also be interpreted as an empty string.
func (*Query) IsNotEmpty ¶
IsNotEmpty returns true, if there is no previous error and the value is not empty. An empty value can also be interpreted as an empty string.
type Struct ¶
type Struct struct {
Members []*Member `xml:"member"`
}
Struct represents an XML-RPC struct.
type Value ¶
type Value struct { I4 string `xml:"i4,omitempty"` Int string `xml:"int,omitempty"` Boolean string `xml:"boolean,omitempty"` ElemString string `xml:"string,omitempty"` FlatString string `xml:",chardata"` Double string `xml:"double,omitempty"` DateTime string `xml:"dateTime.iso8601,omitempty"` Base64 string `xml:"base64,omitempty"` Struct *Struct `xml:"struct"` Array *Array `xml:"array"` XMLName xml.Name `xml:"value"` }
Value represents an XML-RPC value.