Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBucketNameNotUnique = errRange.New( "Duplicate bucket name", "An object storage bucket name must be unique.", errors.PrependDetails("If you wish to reuse the same bucket, then you can export the original Bucket object and reference it from here."), ) ErrUnsupportedOperationOutsideService = errRange.Newf( "Unsupported bucket operation outside of service", "The %s operation can only be performed within a service. Use objects.BucketRef to pass the bucket reference to other, non-service components.", ) ErrBucketRefOutsideService = errRange.New( "Call to objects.BucketRef outside service", "objects.BucketRef can only be called from within a service.", ) ErrBucketNotPublic = errRange.New( "Call to PublicURL for non-public objects.Bucket", "The PublicURL method can only be called on a public bucket.", ) )
View Source
var BucketParser = &resourceparser.Parser{ Name: "Bucket", InterestingImports: []paths.Pkg{"encore.dev/storage/objects"}, Run: func(p *resourceparser.Pass) { name := pkginfo.QualifiedName{Name: "NewBucket", PkgPath: "encore.dev/storage/objects"} spec := &parseutil.ReferenceSpec{ MinTypeArgs: 0, MaxTypeArgs: 0, Parse: parseBucket, } parseutil.FindPkgNameRefs(p.Pkg, []pkginfo.QualifiedName{name}, func(file *pkginfo.File, name pkginfo.QualifiedName, stack []ast.Node) { parseutil.ParseReference(p, spec, parseutil.ReferenceData{ File: file, Stack: stack, ResourceFunc: name, }) }) }, }
Functions ¶
func ResolveBucketUsage ¶
func ResolveBucketUsage(data usage.ResolveData, bkt *Bucket) usage.Usage
Types ¶
type Bucket ¶
type Bucket struct { AST *ast.CallExpr File *pkginfo.File Name string // The unique name of the bucket Doc string // The documentation on the bucket Versioned bool Public bool }
func (*Bucket) ResourceName ¶
type Perm ¶
type Perm string
const ( ListObjects Perm = "list-objects" ReadObjectContents Perm = "read-object-contents" WriteObject Perm = "write-object" UpdateObjectMetadata Perm = "update-object-metadata" GetObjectMetadata Perm = "get-object-metadata" DeleteObject Perm = "delete-object" GetPublicURL Perm = "get-public-url" SignedUploadURL Perm = "signed-upload-url" SignedDownloadURL Perm = "signed-download-url" )
Click to show internal directories.
Click to hide internal directories.