Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // PTrue is a convenience variable that can be used in bindings where // a pointer to a bool (optional parameter) is required. PTrue bool = true // PFalse is a convenience variable that can be used in bindings where // a pointer to a bool (optional parameter) is required. PFalse bool = false )
var (
ErrNotImplemented = errors.New("function not implemented")
)
Functions ¶
func CheckResponseCode ¶
func FiltersToString ¶ added in v1.8.1
FiltersToString converts our typical filter format of a map[string][]string to a query/html safe string.
func NewConnection ¶
NewConnection takes a URI as a string and returns a context with the Connection embedded as a value. This context needs to be passed to each endpoint to work correctly.
A valid URI connection should be scheme:// For example tcp://localhost:<port> or unix:///run/podman/podman.sock or ssh://<user>@<host>[:port]/run/podman/podman.sock?secure=True
Types ¶
type APIResponse ¶
func (*APIResponse) IsClientError ¶
func (h *APIResponse) IsClientError() bool
IsClientError returns true if the response code is 4xx
func (*APIResponse) IsInformational ¶
func (h *APIResponse) IsInformational() bool
IsInformation returns true if the response code is 1xx
func (*APIResponse) IsRedirection ¶
func (h *APIResponse) IsRedirection() bool
IsRedirection returns true if the response code is 3xx
func (*APIResponse) IsServerError ¶
func (h *APIResponse) IsServerError() bool
IsServerError returns true if the response code is 5xx
func (*APIResponse) IsSuccess ¶
func (h *APIResponse) IsSuccess() bool
IsSuccess returns true if the response code is 2xx
func (APIResponse) Process ¶
func (a APIResponse) Process(unmarshalInto interface{}) error
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func GetClient ¶ added in v1.8.1
func GetClient(ctx context.Context) (*Connection, error)
GetClient from context build by NewConnection()
func (*Connection) DoRequest ¶
func (c *Connection) DoRequest(httpBody io.Reader, httpMethod, endpoint string, queryParams url.Values, pathValues ...string) (*APIResponse, error)
DoRequest assembles the http request and returns the response
func (Connection) Version ¶
func (c Connection) Version()