package leases
import "github.com/containerd/containerd/leases"
Index ¶
- Constants
- func FromContext(ctx context.Context) (string, bool)
- func SynchronousDelete(ctx context.Context, o *DeleteOptions) error
- func WithLease(ctx context.Context, lid string) context.Context
- type DeleteOpt
- type DeleteOptions
- type Lease
- type Manager
- type Opt
- func WithExpiration(d time.Duration) Opt
- func WithID(id string) Opt
- func WithLabels(labels map[string]string) Opt
- func WithRandomID() Opt
- type Resource
Constants ¶
const ( // GRPCHeader defines the header name for specifying a containerd lease. GRPCHeader = "containerd-lease" )
Functions ¶
func FromContext ¶
FromContext returns the lease from the context.
func SynchronousDelete ¶
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.
func WithLease ¶
WithLease sets a given lease on the context
Types ¶
type DeleteOpt ¶
type DeleteOpt func(context.Context, *DeleteOptions) error
DeleteOpt allows configuring a delete operation
type DeleteOptions ¶
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 ¶
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 ¶
Opt is used to set options on a lease
func WithExpiration ¶
WithExpiration sets an expiration on the lease
func WithID ¶
WithID sets the ID for the lease
func WithLabels ¶
WithLabels sets labels on a lease
func WithRandomID ¶
func WithRandomID() Opt
WithRandomID sets the lease ID to a random unique value
type Resource ¶
Resource represents low level resource of image, like content, ingest and snapshotter.
Source Files ¶
context.go grpc.go id.go lease.go
Directories ¶
Path | Synopsis |
---|---|
leases/proxy |
- Version
- v1.5.4
- Published
- Jul 19, 2021
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 7 seconds ago –
Tools for package owners.