leases

package
v1.7.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 310

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_github_com_containerd_containerd_api_services_leases_v1_leases_proto protoreflect.FileDescriptor
View Source
var Leases_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "containerd.services.leases.v1.Leases",
	HandlerType: (*LeasesServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Leases_Create_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Leases_Delete_Handler,
		},
		{
			MethodName: "List",
			Handler:    _Leases_List_Handler,
		},
		{
			MethodName: "AddResource",
			Handler:    _Leases_AddResource_Handler,
		},
		{
			MethodName: "DeleteResource",
			Handler:    _Leases_DeleteResource_Handler,
		},
		{
			MethodName: "ListResources",
			Handler:    _Leases_ListResources_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/containerd/containerd/api/services/leases/v1/leases.proto",
}

Leases_ServiceDesc is the grpc.ServiceDesc for Leases service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterLeasesServer

func RegisterLeasesServer(s grpc.ServiceRegistrar, srv LeasesServer)

Types

type AddResourceRequest added in v1.3.0

type AddResourceRequest struct {
	ID       string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
	// contains filtered or unexported fields
}

func (*AddResourceRequest) Descriptor deprecated added in v1.3.0

func (*AddResourceRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddResourceRequest.ProtoReflect.Descriptor instead.

func (*AddResourceRequest) GetID added in v1.7.0

func (x *AddResourceRequest) GetID() string

func (*AddResourceRequest) GetResource added in v1.7.0

func (x *AddResourceRequest) GetResource() *Resource

func (*AddResourceRequest) ProtoMessage added in v1.3.0

func (*AddResourceRequest) ProtoMessage()

func (*AddResourceRequest) ProtoReflect added in v1.7.0

func (x *AddResourceRequest) ProtoReflect() protoreflect.Message

func (*AddResourceRequest) Reset added in v1.3.0

func (x *AddResourceRequest) Reset()

func (*AddResourceRequest) String added in v1.3.0

func (x *AddResourceRequest) String() string

type CreateRequest

type CreateRequest struct {

	// ID is used to identity the lease, when the id is not set the service
	// generates a random identifier for the lease.
	ID     string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Labels map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CreateRequest) Descriptor deprecated

func (*CreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetID added in v1.7.0

func (x *CreateRequest) GetID() string

func (*CreateRequest) GetLabels added in v1.7.0

func (x *CreateRequest) GetLabels() map[string]string

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect added in v1.7.0

func (x *CreateRequest) ProtoReflect() protoreflect.Message

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {
	Lease *Lease `protobuf:"bytes,1,opt,name=lease,proto3" json:"lease,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateResponse) Descriptor deprecated

func (*CreateResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetLease added in v1.7.0

func (x *CreateResponse) GetLease() *Lease

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect added in v1.7.0

func (x *CreateResponse) ProtoReflect() protoreflect.Message

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type DeleteRequest

type DeleteRequest struct {
	ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Sync indicates that the delete and cleanup should be done
	// synchronously before returning to the caller
	//
	// Default is false
	Sync bool `protobuf:"varint,2,opt,name=sync,proto3" json:"sync,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetID added in v1.7.0

func (x *DeleteRequest) GetID() string

func (*DeleteRequest) GetSync added in v1.7.0

func (x *DeleteRequest) GetSync() bool

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect added in v1.7.0

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResourceRequest added in v1.3.0

type DeleteResourceRequest struct {
	ID       string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteResourceRequest) Descriptor deprecated added in v1.3.0

func (*DeleteResourceRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResourceRequest.ProtoReflect.Descriptor instead.

func (*DeleteResourceRequest) GetID added in v1.7.0

func (x *DeleteResourceRequest) GetID() string

func (*DeleteResourceRequest) GetResource added in v1.7.0

func (x *DeleteResourceRequest) GetResource() *Resource

func (*DeleteResourceRequest) ProtoMessage added in v1.3.0

func (*DeleteResourceRequest) ProtoMessage()

func (*DeleteResourceRequest) ProtoReflect added in v1.7.0

func (x *DeleteResourceRequest) ProtoReflect() protoreflect.Message

func (*DeleteResourceRequest) Reset added in v1.3.0

func (x *DeleteResourceRequest) Reset()

func (*DeleteResourceRequest) String added in v1.3.0

func (x *DeleteResourceRequest) String() string

type Lease

type Lease struct {
	ID        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	Labels    map[string]string      `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

Lease is an object which retains resources while it exists.

func (*Lease) Descriptor deprecated

func (*Lease) Descriptor() ([]byte, []int)

Deprecated: Use Lease.ProtoReflect.Descriptor instead.

func (*Lease) GetCreatedAt added in v1.7.0

func (x *Lease) GetCreatedAt() *timestamppb.Timestamp

func (*Lease) GetID added in v1.7.0

func (x *Lease) GetID() string

func (*Lease) GetLabels added in v1.7.0

func (x *Lease) GetLabels() map[string]string

func (*Lease) ProtoMessage

func (*Lease) ProtoMessage()

func (*Lease) ProtoReflect added in v1.7.0

func (x *Lease) ProtoReflect() protoreflect.Message

func (*Lease) Reset

func (x *Lease) Reset()

func (*Lease) String

func (x *Lease) String() string

type LeasesClient

type LeasesClient interface {
	// Create creates a new lease for managing changes to metadata. A lease
	// can be used to protect objects from being removed.
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	// Delete deletes the lease and makes any unreferenced objects created
	// during the lease eligible for garbage collection if not referenced
	// or retained by other resources during the lease.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// List lists all active leases, returning the full list of
	// leases and optionally including the referenced resources.
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	// AddResource references the resource by the provided lease.
	AddResource(ctx context.Context, in *AddResourceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// DeleteResource dereferences the resource by the provided lease.
	DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// ListResources lists all the resources referenced by the lease.
	ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error)
}

LeasesClient is the client API for Leases service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewLeasesClient

func NewLeasesClient(cc grpc.ClientConnInterface) LeasesClient

type LeasesServer

type LeasesServer interface {
	// Create creates a new lease for managing changes to metadata. A lease
	// can be used to protect objects from being removed.
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// Delete deletes the lease and makes any unreferenced objects created
	// during the lease eligible for garbage collection if not referenced
	// or retained by other resources during the lease.
	Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
	// List lists all active leases, returning the full list of
	// leases and optionally including the referenced resources.
	List(context.Context, *ListRequest) (*ListResponse, error)
	// AddResource references the resource by the provided lease.
	AddResource(context.Context, *AddResourceRequest) (*emptypb.Empty, error)
	// DeleteResource dereferences the resource by the provided lease.
	DeleteResource(context.Context, *DeleteResourceRequest) (*emptypb.Empty, error)
	// ListResources lists all the resources referenced by the lease.
	ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error)
	// contains filtered or unexported methods
}

LeasesServer is the server API for Leases service. All implementations must embed UnimplementedLeasesServer for forward compatibility

type ListRequest

type ListRequest struct {
	Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetFilters added in v1.7.0

func (x *ListRequest) GetFilters() []string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect added in v1.7.0

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResourcesRequest added in v1.3.0

type ListResourcesRequest struct {
	ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResourcesRequest) Descriptor deprecated added in v1.3.0

func (*ListResourcesRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListResourcesRequest.ProtoReflect.Descriptor instead.

func (*ListResourcesRequest) GetID added in v1.7.0

func (x *ListResourcesRequest) GetID() string

func (*ListResourcesRequest) ProtoMessage added in v1.3.0

func (*ListResourcesRequest) ProtoMessage()

func (*ListResourcesRequest) ProtoReflect added in v1.7.0

func (x *ListResourcesRequest) ProtoReflect() protoreflect.Message

func (*ListResourcesRequest) Reset added in v1.3.0

func (x *ListResourcesRequest) Reset()

func (*ListResourcesRequest) String added in v1.3.0

func (x *ListResourcesRequest) String() string

type ListResourcesResponse added in v1.3.0

type ListResourcesResponse struct {
	Resources []*Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResourcesResponse) Descriptor deprecated added in v1.3.0

func (*ListResourcesResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResourcesResponse.ProtoReflect.Descriptor instead.

func (*ListResourcesResponse) GetResources added in v1.7.0

func (x *ListResourcesResponse) GetResources() []*Resource

func (*ListResourcesResponse) ProtoMessage added in v1.3.0

func (*ListResourcesResponse) ProtoMessage()

func (*ListResourcesResponse) ProtoReflect added in v1.7.0

func (x *ListResourcesResponse) ProtoReflect() protoreflect.Message

func (*ListResourcesResponse) Reset added in v1.3.0

func (x *ListResourcesResponse) Reset()

func (*ListResourcesResponse) String added in v1.3.0

func (x *ListResourcesResponse) String() string

type ListResponse

type ListResponse struct {
	Leases []*Lease `protobuf:"bytes,1,rep,name=leases,proto3" json:"leases,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

func (*ListResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetLeases added in v1.7.0

func (x *ListResponse) GetLeases() []*Lease

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect added in v1.7.0

func (x *ListResponse) ProtoReflect() protoreflect.Message

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type Resource added in v1.3.0

type Resource struct {
	ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// For snapshotter resource, there are many snapshotter types here, like
	// overlayfs, devmapper etc. The type will be formatted with type,
	// like "snapshotter/overlayfs".
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*Resource) Descriptor deprecated added in v1.3.0

func (*Resource) Descriptor() ([]byte, []int)

Deprecated: Use Resource.ProtoReflect.Descriptor instead.

func (*Resource) GetID added in v1.7.0

func (x *Resource) GetID() string

func (*Resource) GetType added in v1.7.0

func (x *Resource) GetType() string

func (*Resource) ProtoMessage added in v1.3.0

func (*Resource) ProtoMessage()

func (*Resource) ProtoReflect added in v1.7.0

func (x *Resource) ProtoReflect() protoreflect.Message

func (*Resource) Reset added in v1.3.0

func (x *Resource) Reset()

func (*Resource) String added in v1.3.0

func (x *Resource) String() string

type UnimplementedLeasesServer added in v1.4.0

type UnimplementedLeasesServer struct {
}

UnimplementedLeasesServer must be embedded to have forward compatible implementations.

func (UnimplementedLeasesServer) AddResource added in v1.4.0

func (UnimplementedLeasesServer) Create added in v1.4.0

func (UnimplementedLeasesServer) Delete added in v1.4.0

func (UnimplementedLeasesServer) DeleteResource added in v1.4.0

func (UnimplementedLeasesServer) List added in v1.4.0

func (UnimplementedLeasesServer) ListResources added in v1.4.0

type UnsafeLeasesServer added in v1.7.0

type UnsafeLeasesServer interface {
	// contains filtered or unexported methods
}

UnsafeLeasesServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LeasesServer will result in compilation errors.

Jump to

Keyboard shortcuts

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