HttpService

package
v0.0.0-...-f8f558a Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

README

��# HttpService

Install
go get "github.com/ivan-kostko/GoLibs/Repository/DataSource/Implementations/HttpService"
Import
"github.com/ivan-kostko/GoLibs/Repository/DataSource/Implementations"
_ "github.com/ivan-kostko/GoLibs/Repository/DataSource/Implementations/HttpService"
Description
The package represents generic Http service data source

Usage

const (
	ERR_IVALIDCONFTYPE    = "HttpService: Invalid configuration type"
	ERR_WONTBUILDREQUEST  = "HttpService: Wont build http.Request due to internal error: "
	ERR_WONTINVOKEREQUEST = "HttpService: Wont invoke the Request due to internal error: "
	ERR_INVALIDRESPONSE   = "HttpService: Returned invalid response: "
	ERR_WONTREADRESPONSE  = "HttpService: Wont read the Response due to internal error: "
)
func GetNewHttpServiceDataSource
func GetNewHttpServiceDataSource(conf interface{}) (*ds.DataSource, *Error)

Generic HTTP service data source factory NB!: conf should be of type HttpService.Configuration. Otherwise it returns InvalidArgument, ERR_IVALIDCONFTYPE

type Configuration
type Configuration struct {
	// The url for the service which will be followed by slash "/" and parametrised instructions
	MainUrl string

	Headers map[string][]string
	// Checks response for http errors
	CheckResponse func(*http.Response) *Error
}

The type represents configuration for HTTP service data source

Documentation

Overview

Install

go get "github.com/ivan-kostko/GoLibs/Repository/DataSource/Implementations/HttpService"

Import

"github.com/ivan-kostko/GoLibs/Repository/DataSource/Implementations"
_ "github.com/ivan-kostko/GoLibs/Repository/DataSource/Implementations/HttpService"

Description

The package represents generic Http service data source

Index

Constants

View Source
const (
	ERR_IVALIDCONFTYPE    = "HttpService: Invalid configuration type"
	ERR_WONTBUILDREQUEST  = "HttpService: Wont build http.Request due to internal error: "
	ERR_WONTINVOKEREQUEST = "HttpService: Wont invoke the Request due to internal error: "
	ERR_INVALIDRESPONSE   = "HttpService: Returned invalid response: "
	ERR_WONTREADRESPONSE  = "HttpService: Wont read the Response due to internal error: "
)

Variables

This section is empty.

Functions

func GetNewHttpServiceDataSource

func GetNewHttpServiceDataSource(conf interface{}) (*ds.DataSource, *Error)

Generic HTTP service data source factory NB!: conf should be of type HttpService.Configuration. Otherwise it returns InvalidArgument, ERR_IVALIDCONFTYPE

Types

type Configuration

type Configuration struct {
	// The url for the service which will be followed by slash "/" and parametrised instructions
	MainUrl string

	Headers map[string][]string
	// Checks response for http errors
	CheckResponse func(*http.Response) *Error
}

The type represents configuration for HTTP service data source

Jump to

Keyboard shortcuts

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