types

package
v0.2.3-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: AGPL-3.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

View Source
const (
	BucketTypeAbbr = "b"
	ObjectTypeAbbr = "o"
	GroupTypeAbbr  = "g"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GRN

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

GRN define a standard ResourceName format, full name: GreenFieldResourceName valid format:

bucket: "grn:b::bucketName"
object: "grn:o::bucketName/objectName"
group: "grn:g:ownerAddress:groupName"

Notice: all the name support wildcards

func NewBucketGRN

func NewBucketGRN(bucketName string) *GRN

NewBucketGRN use to generate a bucket resource with specify bucketName The bucketName support wildcards. E.g. samplebucket, sample*bucket, sample?bucket

func NewGroupGRN

func NewGroupGRN(owner sdk.AccAddress, groupName string) *GRN

func NewObjectGRN

func NewObjectGRN(bucketName, objectName string) *GRN

func (*GRN) GetBucketAndObjectName

func (r *GRN) GetBucketAndObjectName() (string, string, error)

func (*GRN) GetBucketName

func (r *GRN) GetBucketName() (string, error)

func (*GRN) GetGroupOwnerAndAccount

func (r *GRN) GetGroupOwnerAndAccount() (sdk.AccAddress, string, error)

func (*GRN) MustGetBucketAndObjectName

func (r *GRN) MustGetBucketAndObjectName() (string, string)

func (*GRN) MustGetBucketName

func (r *GRN) MustGetBucketName() string

func (*GRN) MustGetGroupOwnerAndAccount

func (r *GRN) MustGetGroupOwnerAndAccount() (sdk.AccAddress, string)

func (*GRN) ParseFromString

func (r *GRN) ParseFromString(res string, wildcards bool) error

func (*GRN) ResourceType

func (r *GRN) ResourceType() resource.ResourceType

func (*GRN) String

func (r *GRN) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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