Categorygithub.com/onego-project/xmlrpc
modulepackage
1.1.0
Repository: https://github.com/onego-project/xmlrpc.git
Documentation: pkg.go.dev

# README

Build Status

xmlrpc

XMLRPC Go library is designed to make it easy to create an XMLRPC client, making method calls and receiving method responses.

The library is compliant with the XML-RPC specification published by http://www.xmlrpc.org/.

Requirements

  • Go 1.9 or newer to compile
  • Go dep tool to manage dependencies
  • gometalinter tool to run Go lint tools and normalise their output

Installation

The recommended way to install this library is using go get:

go get -u github.com/onego-project/xmlrpc

Usage examples

Short usage example expects xml-rpc server running at localhost:8000 with method pow which takes 2 integers and returns one int value.

package main

import (
	"github.com/onego-project/xmlrpc"
	"context"
	"fmt"
)

func main() {
	client := xmlrpc.NewClient("http://localhost:8000/")

	ctx := context.TODO()

	result, err := client.Call(ctx, "pow", 3, 4)
	if err != nil {
		fmt.Printf("Error: %s\n", err)
		return
	}

	fmt.Println("Result kind:", result.Kind())
	fmt.Println("Result:", result.ResultInt())
}

Contributing

  1. Fork xmlrpc library
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

# Functions

IsTemporary returns true if err is temporary.
IsTimeout returns true if err is caused by timeout.
NewClient is an XML-RPC client constructor.

# Constants

Constants representing XML-RPC data types.
Constants representing XML-RPC data types.
Constants representing XML-RPC data types.
Constants representing XML-RPC data types.
Constants representing XML-RPC data types.
Constants representing XML-RPC data types.
Constants representing XML-RPC data types.
Constants representing XML-RPC data types.
Constants representing XML-RPC data types.

# Variables

LogErrorFunc can be set from outside the library to allow error logging.

# Structs

Client is an XML-RPC client.
Result represents a return value from XML-RPC method call.

# Type aliases

Kind represents a data types available in XML-RPC standard.