wedeploy

package module
v0.0.0-...-3c570b5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: BSD-3-Clause Imports: 14 Imported by: 0

README

Go API Client for WeDeploy Project Build Status Coverage Status codebeat badge Go Report Card GoDoc

To install:

go get -u github.com/wedeploy/wedeploy-sdk-go

Contributing

You can get the latest wedeploy-sdk-go source code with go get -u github.com/wedeploy/wedeploy-sdk-go

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Integration tests should be written as well.

The master branch of this repository on GitHub is protected:

  • force-push is disabled
  • tests MUST pass on Travis before merging changes to master
  • branches MUST be up to date with master before merging

Keep your commits neat. Try to always rebase your changes before publishing them.

goreportcard can be used online or locally to detect defects and static analysis results from tools such as go vet, go lint, gocyclo, and more. Run errcheck to fix ignored error returns.

Using go test and go cover are essential to make sure your code is covered with unit tests.

License

BSD-3-Clause, © Liferay, Inc.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version of Go API Client for WeDeploy Project
	Version = "master"
	// UserAgent of the WeDeploy wedeploy-sdk-go client
	UserAgent = "WeDeploy/" + Version + " (+https://wedeploy.com)"
)

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient of the library

func Client

func Client() *HTTPClient

Client used by default for requests

func NewHTTPClient

func NewHTTPClient() *HTTPClient

NewHTTPClient to use an alternative HTTP Client

func (*HTTPClient) HTTP

func (h *HTTPClient) HTTP() *http.Client

HTTP gets the HTTP client

func (*HTTPClient) SetHTTP

func (h *HTTPClient) SetHTTP(hc *http.Client)

SetHTTP sets the default HTTP Client to use

func (*HTTPClient) URL

func (h *HTTPClient) URL(uri string, paths ...string) *WeDeploy

URL creates a new request object

type StatusError

type StatusError struct {
	Code int
}

StatusError is used for HTTP status code >= 400

func (StatusError) Error

func (s StatusError) Error() string

type WeDeploy

type WeDeploy struct {
	ID          int
	URL         string
	Time        time.Time
	Query       *query.Builder
	FormValues  *url.Values
	Headers     http.Header
	RequestBody io.Reader
	Request     *http.Request
	Response    *http.Response
	// contains filtered or unexported fields
}

WeDeploy is the structure for a WeDeploy query

func URL

func URL(uri string, paths ...string) *WeDeploy

URL creates a new request object

func (*WeDeploy) Aggregate

func (w *WeDeploy) Aggregate(ai ...interface{}) *WeDeploy

Aggregate adds an Aggregate query to the request

func (*WeDeploy) Auth

func (w *WeDeploy) Auth(args ...string) *WeDeploy

Auth sets HTTP basic auth headers

func (*WeDeploy) Body

func (w *WeDeploy) Body(body io.Reader) *WeDeploy

Body sets the body for the request

func (*WeDeploy) Context

func (w *WeDeploy) Context() context.Context

Context gets the existing request context

func (*WeDeploy) Count

func (w *WeDeploy) Count() *WeDeploy

Count adds a Count query to the request

func (*WeDeploy) DecodeJSON

func (w *WeDeploy) DecodeJSON(class interface{}) (err error)

DecodeJSON decodes a JSON response

func (*WeDeploy) Delete

func (w *WeDeploy) Delete() error

Delete method

func (*WeDeploy) Filter

func (w *WeDeploy) Filter(ai ...interface{}) *WeDeploy

Filter adds a Filter query to the request

func (*WeDeploy) Form

func (w *WeDeploy) Form(key, value string) *WeDeploy

Form adds a Form query to the request

func (*WeDeploy) Get

func (w *WeDeploy) Get() error

Get method

func (*WeDeploy) Head

func (w *WeDeploy) Head() error

Head method

func (*WeDeploy) Header

func (w *WeDeploy) Header(key, value string) *WeDeploy

Header adds a new header to the request

func (*WeDeploy) Highlight

func (w *WeDeploy) Highlight(field string) *WeDeploy

Highlight adds a Highlight query to the request

func (*WeDeploy) Limit

func (w *WeDeploy) Limit(limit int) *WeDeploy

Limit adds a Limit query to the request

func (*WeDeploy) Offset

func (w *WeDeploy) Offset(offset int) *WeDeploy

Offset adds an Offset query to the request

func (*WeDeploy) Param

func (w *WeDeploy) Param(key, value string) *WeDeploy

Param sets a query string param to the Request URL Check TestParamParsingErrorSilentFailure if you find unexpected result

func (*WeDeploy) Params

func (w *WeDeploy) Params() url.Values

Params gets the params from the Request URL Check TestParamsParsingErrorSilentFailure if you find unexpected result

func (*WeDeploy) Patch

func (w *WeDeploy) Patch() error

Patch method

func (*WeDeploy) Path

func (w *WeDeploy) Path(paths ...string) *WeDeploy

Path creates a new WeDeploy object composing paths

func (*WeDeploy) Post

func (w *WeDeploy) Post() error

Post method

func (*WeDeploy) Put

func (w *WeDeploy) Put() error

Put method

func (*WeDeploy) SetContext

func (w *WeDeploy) SetContext(ctx context.Context)

SetContext for the request

func (*WeDeploy) Sort

func (w *WeDeploy) Sort(field string, direction ...string) *WeDeploy

Sort adds a Sort query to the request

func (*WeDeploy) Timeout

func (w *WeDeploy) Timeout(timeout time.Duration)

Timeout for the request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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