buckets

package
v2.6.20 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// CollectionName is the name of the threaddb collection used for buckets.
	CollectionName = "buckets"
	// SeedName is the file name reserved for a random bucket seed.
	SeedName = ".textileseed"
)

Variables

View Source
var (
	// ErrNonFastForward is returned when an update in non-fast-forward.
	ErrNonFastForward = fmt.Errorf("update is non-fast-forward")

	// ErrNoCurrentArchive is returned when not status about the last archive
	// can be retrieved, since the bucket was never archived.
	ErrNoCurrentArchive = fmt.Errorf("the bucket was never archived")

	// ErrZeroBalance is returned when archiving a bucket which
	// underlying Account Powergate user balance is zero.
	ErrZeroBalance = errors.New("wallet FIL balance is zero, if recently created wait 30s")
)

Functions

func NewBucketOwnerContext added in v2.1.4

func NewBucketOwnerContext(ctx context.Context, owner *BucketOwner) context.Context

func RolesFromPb

func RolesFromPb(in map[string]pb.PathAccessRole) (map[string]Role, error)

RolesFromPb maps protobuf type roles to native type roles.

func RolesToPb

func RolesToPb(in map[string]Role) (map[string]pb.PathAccessRole, error)

RolesToPb maps native type roles to protobuf type roles.

Types

type BucketOwner added in v2.1.4

type BucketOwner struct {
	StorageUsed      int64
	StorageAvailable int64
	StorageDelta     int64
}

BucketOwner provides owner context to the bucket service.

func BucketOwnerFromContext added in v2.1.4

func BucketOwnerFromContext(ctx context.Context) (*BucketOwner, bool)

type Role

type Role int

Role describes an access role for a bucket item.

const (
	None Role = iota
	Reader
	Writer
	Admin
)

func NewRoleFromString

func NewRoleFromString(s string) (Role, error)

NewRoleFromString returns the role associated with the given string.

func (Role) String

func (r Role) String() string

String returns the string representation of the role.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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