Documentation ¶
Overview ¶
Package bindings provides golang-based access to the Podman REST API. Users can then interact with API endpoints to manage containers, images, pods, etc.
This package exposes a series of methods that allow users to firstly create their connection with the API endpoints. Once the connection is established, users can then manage the Podman container runtime.
Index ¶
- Variables
- func CheckResponseCode(inError error) (int, error)
- func FiltersToString(filters map[string][]string) (string, error)
- func JoinURL(elements ...string) string
- func NewConnection(ctx context.Context, uri string) (context.Context, error)
- func NewConnectionWithIdentity(ctx context.Context, uri string, identity string) (context.Context, error)
- type APIResponse
- type Connection
Constants ¶
This section is empty.
Variables ¶
var ( PTrue = &pTrue PFalse = &pFalse // APIVersion - podman will fail to run if this value is wrong APIVersion = semver.MustParse("1.0.0") )
var ( BasePath = &url.URL{ Scheme: "http", Host: "d", Path: "/v" + APIVersion.String() + "/libpod", } )
var (
ErrNotImplemented = errors.New("function not implemented")
)
Functions ¶
func CheckResponseCode ¶
func FiltersToString ¶
FiltersToString converts our typical filter format of a map[string][]string to a query/html safe string.
func NewConnectionWithIdentity ¶
func NewConnectionWithIdentity(ctx context.Context, uri string, identity string) (context.Context, error)
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