Skip to content

clarechu/go-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-client

简单实现远程调用

package main

import (
	"fmt"
	"github.com/clarechu/go-client/rest"
)

// Get 请求 
func Get(host, username, password string) error {
	var result interface{}
	clientSet, err := rest.RESTClientFor(rest.NewDefaultConfig(host, username, password))
	if err != nil {
		return fmt.Errorf("%v", err)
	}
	clientSet.Get().Resource("projects").
		Name("demo").
		Do().
		Into(&result)

	return err
}

About

golang simple http client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages