api

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package api provides different types of functions for making http request and reading responses.

Index

Constants

View Source
const (
	UrlBase     = "https://cgc-api.sbgenomics.com/v2"
	UrlProjects = UrlBase + "/projects"
	UrlFiles    = UrlBase + "/files"
)

Variables

This section is empty.

Functions

func CGCRequest

func CGCRequest(method string, url string, body io.Reader) (resp *http.Response, err error)

CGCRequest will make a http request based on method, url & body. It will return http response only if it's 200. If it is not 200, error with body message will be returned

func CGCRequestAndRead

func CGCRequestAndRead(method string, url string, body io.Reader) (respBody []byte, err error)

CGCRequestAndRead is wrapper around CGCRequest. Read the response body until EOF.

func CGCRequestAndReadTotalOffset

func CGCRequestAndReadTotalOffset(method string, url string, body io.Reader) (bytesResp []byte, totalOffset int, err error)

CGCRequestAndReadTotalOffset is wrapper around CGCRequest. Read the response body until EOF. Returns X-Total-Matching-Query header value.

Types

This section is empty.

Directories

Path Synopsis
Package files provides API calls related to files.
Package files provides API calls related to files.
Package projects provides API calls related to projects.
Package projects provides API calls related to projects.

Jump to

Keyboard shortcuts

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