cloudlock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GcloudProjectId      string
	GcloudRegion         string
	GcloudServiceAccount string
	CloudlockBucket      string
)

Functions

This section is empty.

Types

type GCS

type GCS struct {
	// contains filtered or unexported fields
}

GCS is an implementation of the Locker interface backed by Google Cloud Storage.

func NewGCS

func NewGCS(bucketName string) *GCS

NewGCS returns a new GCS instance.

func (*GCS) IsLocked

func (gcs *GCS) IsLocked(lockname string) (bool, error)

IsLocked returns true if the lock file exists in the GCS.

func (*GCS) Lock

func (gcs *GCS) Lock(lockname string, payload []byte, wait bool) error

Lock creates a lock file in the GCS.

func (*GCS) Teardown

func (gcs *GCS) Teardown() error

Teardown cleans up the GCS connections.

func (*GCS) Unlock

func (gcs *GCS) Unlock(lockname string) ([]byte, error)

Unlock removes a lock file from the GCS.

Jump to

Keyboard shortcuts

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