restutil

package
v0.0.0-...-3b9b04e Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2017 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BufferSize = 24
)
View Source
const Useragent = "up-restutil"

Variables

View Source
var (
	Transport = &http.Transport{
		MaxIdleConnsPerHost: 128,
		Dial: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
		}).Dial,
	}

	HttpClient = &http.Client{
		Transport: Transport,
	}
)

Functions

func DiffIDs

func DiffIDs(sourceURL, destURL string) error

func GetAllRest

func GetAllRest(baseURL string, throttle int) (err error)

func PutAllBinaryRest

func PutAllBinaryRest(baseFromURL string, baseToURL string, user string, pass string, conns int, throttle int, dumpFailed bool) (err error)

func PutAllRest

func PutAllRest(baseURL string, idProperty string, user string, pass string, conns int, dumpFailed bool) error

func SyncIDs

func SyncIDs(service *SyncService) error

Types

type IDListRetriever

type IDListRetriever interface {
	Retrieve(chan<- string, chan<- error)
}

IDListRetriever is the interface used for retrieving UUIDs from a provided source

Retrieve receives 2 unbuffered channels, one for IDs and the other for errors, and populates them accordingly as the function runs.

func GetIDListRetriever

func GetIDListRetriever(filePath string, URL string) IDListRetriever

type SyncService

type SyncService struct {
	SourceIDsRetriever IDListRetriever
	DestIDsRetriever   IDListRetriever
	SourceURL          string
	DestURL            string
	MaxConcurrentReqs  int
	MinExecTime        int
	Retries            int
	Deletes            bool
}

Jump to

Keyboard shortcuts

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