Skip to content

Commit

Permalink
more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
klauern committed Sep 18, 2015
1 parent ea51c58 commit 99283e2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions wls/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 99283e2

Please sign in to comment.