util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

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