Documentation ¶
Index ¶
Constants ¶
View Source
const (
// GRPCHeader defines the header name for specifying a containerd lease.
GRPCHeader = "containerd-lease"
)
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶ added in v1.2.0
FromContext returns the lease from the context.
func SynchronousDelete ¶ added in v1.2.0
func SynchronousDelete(ctx context.Context, o *DeleteOptions) error
SynchronousDelete is used to indicate that a lease deletion and removal of any unreferenced resources should occur synchronously before returning the result.
Types ¶
type DeleteOpt ¶ added in v1.2.0
type DeleteOpt func(context.Context, *DeleteOptions) error
DeleteOpt allows configuring a delete operation
type DeleteOptions ¶ added in v1.2.0
type DeleteOptions struct {
Synchronous bool
}
DeleteOptions provide options on image delete
type Lease ¶
Lease retains resources to prevent cleanup before the resources can be fully referenced.
type Manager ¶ added in v1.2.0
type Manager interface { Create(context.Context, ...Opt) (Lease, error) Delete(context.Context, Lease, ...DeleteOpt) error List(context.Context, ...string) ([]Lease, error) AddResource(context.Context, Lease, Resource) error DeleteResource(context.Context, Lease, Resource) error ListResources(context.Context, Lease) ([]Resource, error) }
Manager is used to create, list, and remove leases
type Opt ¶ added in v1.2.0
Opt is used to set options on a lease
func WithExpiration ¶ added in v1.2.0
WithExpiration sets an expiration on the lease
func WithLabels ¶ added in v1.2.0
WithLabels sets labels on a lease
func WithRandomID ¶ added in v1.2.0
func WithRandomID() Opt
WithRandomID sets the lease ID to a random unique value
Click to show internal directories.
Click to hide internal directories.