Documentation ¶
Overview ¶
Package gcslock is a scalable, distributed mutex that can be used to serialize computations anywhere on the global internet.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextLocker ¶
type ContextLocker interface { sync.Locker LockWithValue(string) ContextLock(context.Context) error ContextLockWithValue(context.Context, string) error ContextUnlock(context.Context) error ReadValue(context.Context, string, string) (string, error) }
ContextLocker provides an extension of the sync.Locker interface.
func New ¶
func New(ctx context.Context, bucket, object string) (ContextLocker, error)
New creates a GCS-based sync.Locker. It uses Application Default Credentials to make authenticated requests to Google Cloud Storage. See the DefaultClient function of the golang.org/x/oauth2/google package for App Default Credentials details.
If ctx argument is nil, context.Background is used.
func NewWithClient ¶
func NewWithClient(client *http.Client, bucket, object string) ContextLocker
Click to show internal directories.
Click to hide internal directories.