gcslock

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

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

Jump to

Keyboard shortcuts

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