goutils

package module
v0.0.0-...-ebaa66c Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2014 License: MIT Imports: 8 Imported by: 0

README

Common Utility functions for GO programs

Installation

go get github.com/bobbyabraham/goutils

Go doc

See Go Doc

HTTP utility functions

  • http put
  • http get

File Utility functions

  • list of all files present in a directory and all sub directories within it
  • compute checksum given a file name and path

Documentation

Overview

Utility package - provides commonly used utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PerformHttpGetRequest

func PerformHttpGetRequest(url, username, password string) (int, []byte, error)

PerformHttpGetRequest- self explanatory sends an http get request to the supplied url (using the supplied user name and password for basic http authentication - if needed). The function returns the http return status code, the return payload as a byte array

func PerformHttpPutRequest

func PerformHttpPutRequest(url, username, password string,
	dataToSend []byte) (int, []byte, error)

PerformHttpPutRequest - self explanatory sends an http put reuest to the supplied url (using the supplied user name and password for basic http authentication - if needed) with the supplied data as payload. The function returns the http return status code, the return payload as a byte array

Types

type FileInfo

type FileInfo struct {
	Name     string
	Basepath string
}

func CreateListOfAllFiles

func CreateListOfAllFiles(path string) ([]FileInfo, error)

createListOfAllFiles takes in a basepath for a directory and returns the list of all files present within that directory and all its sub directories recursively

Jump to

Keyboard shortcuts

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