xmlrpc

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2019 License: MIT Imports: 12 Imported by: 19

README

go-xmlrpc

xmlrpc interface for go

Usage

package main

import (
	"github.com/mattn/go-xmlrpc"
	"fmt"
	"log"
)

func main() {
	res, e := xmlrpc.Call(
		"http://your-blog.example.com/xmlrpc.php",
		"metaWeblog.getRecentPosts",
		"blog-id",
		"user-id",
		"password",
		10)
	if e != nil {
		log.Fatal(e)
	}
	for _, p := range res.(xmlrpc.Array) {
		for k, v := range p.(xmlrpc.Struct) {
			fmt.Printf("%s=%v\n", k, v)
		}
		fmt.Println()
	}
}

Installation

$ go get github.com/mattn/go-xmlrpc

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(url, name string, args ...interface{}) (v interface{}, e error)

Call call remote procedures function name with args

Types

type Array

type Array []interface{}

type Client

type Client struct {
	HttpClient *http.Client
	// contains filtered or unexported fields
}

Client is client of XMLRPC

func NewClient

func NewClient(url string) *Client

NewClient create new Client

func (*Client) Call

func (c *Client) Call(name string, args ...interface{}) (v interface{}, e error)

Call call remote procedures function name with args

type Struct

type Struct map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL