Documentation ¶
Index ¶
- func ToOperationName(opName string) (*referencePb.ObjectReference, error)
- func ToOperationNameList(opNames []string) ([]*referencePb.ObjectReference, error)
- func ToOperationNameString(opName *referencePb.ObjectReference) string
- type LeaseManager
- func (lm *LeaseManager) AcquireLease() (string, error)
- func (lm *LeaseManager) CheckAcquire(op *internalPb.OperationInternalProto) error
- func (lm *LeaseManager) CheckLease(lease *internalPb.LeaseInternalProto) error
- func (lm *LeaseManager) FromLeaseToken(token string) (*internalPb.LeaseInternalProto, error)
- func (lm *LeaseManager) ToLeaseToken(lease *internalPb.LeaseInternalProto) (string, error)
- func (lm *LeaseManager) VerifyLease(originalLease *internalPb.LeaseInternalProto, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToOperationName ¶
func ToOperationName(opName string) (*referencePb.ObjectReference, error)
ToOperationName converts stringified OperationName to the proto.
func ToOperationNameList ¶
func ToOperationNameList(opNames []string) ([]*referencePb.ObjectReference, error)
ToOperationNameList converts stringified OperationName to the proto.
func ToOperationNameString ¶
func ToOperationNameString(opName *referencePb.ObjectReference) string
ToOperationNameString stringifys OperationName.
Types ¶
type LeaseManager ¶
type LeaseManager struct {
// contains filtered or unexported fields
}
LeaseManager handles lease management operations such as checking expiration and timestamping.
func NewLeaseManager ¶
func NewLeaseManager(deadline time.Duration, crypter util.Crypter) *LeaseManager
NewLeaseManager creates a lease manager.
func (*LeaseManager) AcquireLease ¶
func (lm *LeaseManager) AcquireLease() (string, error)
AcquireLease acquires a lease for the operation.
func (*LeaseManager) CheckAcquire ¶
func (lm *LeaseManager) CheckAcquire(op *internalPb.OperationInternalProto) error
CheckAcquire determines if the operation can be acquired.
func (*LeaseManager) CheckLease ¶
func (lm *LeaseManager) CheckLease(lease *internalPb.LeaseInternalProto) error
CheckLease returns an error if the lease is
func (*LeaseManager) FromLeaseToken ¶
func (lm *LeaseManager) FromLeaseToken(token string) (*internalPb.LeaseInternalProto, error)
FromLeaseToken converts a lease token to the protobuf.
func (*LeaseManager) ToLeaseToken ¶
func (lm *LeaseManager) ToLeaseToken(lease *internalPb.LeaseInternalProto) (string, error)
ToLeaseToken converts the protobuf to an encrypted base-64 encoded string for outside transport.
func (*LeaseManager) VerifyLease ¶
func (lm *LeaseManager) VerifyLease(originalLease *internalPb.LeaseInternalProto, assertedLease *internalPb.LeaseInternalProto) error
VerifyLease for updating an operation.