From 99283e26ffa2d73d9a6e7580c1fd84796ea952d2 Mon Sep 17 00:00:00 2001 From: Nick Klauer Date: Fri, 18 Sep 2015 14:53:55 -0500 Subject: [PATCH] more documentation --- wls/client.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wls/client.go b/wls/client.go index e9c7fd7..7224527 100644 --- a/wls/client.go +++ b/wls/client.go @@ -32,8 +32,10 @@ type AdminServer struct { // We simply wrap that so we can get to the meat of it in the underlying Server type // // Wrapper is composed of 3 pieces: -// - Body contains the result of the resource request, included as either a specific Item (Datasource, Server, -// Cluster, or Application, or an array of []Item's of the same. +// - Body contains +// - the result of the resource request, included as either a specific Item (Datasource, Server, +// Cluster, or Application, or +// - an array of []Item's of the same. // - Messages contains any error-related messages related to the query. type Wrapper struct { Body struct { @@ -43,6 +45,12 @@ type Wrapper struct { Messages []string `json:"messages,omitempty"` } +// requestResource is a wrapper around an http.Client{} instance assuming the following: +// - the request is a GET +// - assumes a JSON Accept header +// - set Basic Authentication based on the *AdminServer passed in +// +// returns the *http.Response or an error func requestResource(url string, e *AdminServer) (*http.Response, error) { client := &http.Client{} req, err := http.NewRequest("GET", url, nil)