version

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIVersion

func APIVersion(ctx context.Context) string

APIVersion gets the API version from the passed in context If no version is set then an empty string will be returned.

func FromEnv

func FromEnv(ctx context.Context) context.Context

FromEnv sets the API version to use from the DOCKER_API_VERSION environment variable This is like how the Docker CLI sets a specific API version.

func Join

func Join(ctx context.Context, uri string) string

Join adds the API version stored in the context to the provided uri

func LessThan

func LessThan(v, other string) bool

LessThan checks if a version is less than another

func Negotiate

func Negotiate(ctx context.Context, srv string) context.Context

Negotiate looks at the version currently in ctx and the verion of the server. It returns a context with the best api version to use.

func WithAPIVersion

func WithAPIVersion(ctx context.Context, version string) context.Context

WithAPIVersion stores the API version to make a request with in the provided context

Types

This section is empty.

Jump to

Keyboard shortcuts

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