Versions in this module Expand all Collapse all v0 v0.1.6 Jun 19, 2021 Changes in this version + const DeleteAction + const JSONPayload + const NoPayload + const ObjectArchiveEvent + const ObjectDeleteEvent + const ObjectFinalizeEvent + const ObjectMetadataUpdateEvent + const ScopeFullControl + const ScopeReadOnly + const ScopeReadWrite + const SetStorageClassAction + var ErrBucketNotExist = errors.New("storage: bucket doesn't exist") + var ErrObjectNotExist = errors.New("storage: object doesn't exist") + func SignedURL(bucket, name string, opts *SignedURLOptions) (string, error) + type ACLEntity string + const AllAuthenticatedUsers + const AllUsers + type ACLHandle struct + func (a *ACLHandle) Delete(ctx context.Context, entity ACLEntity) (err error) + func (a *ACLHandle) List(ctx context.Context) (rules []ACLRule, err error) + func (a *ACLHandle) Set(ctx context.Context, entity ACLEntity, role ACLRole) (err error) + type ACLRole string + const RoleOwner + const RoleReader + const RoleWriter + type ACLRule struct + Domain string + Email string + Entity ACLEntity + EntityID string + ProjectTeam *ProjectTeam + Role ACLRole + type BucketAttrs struct + ACL []ACLRule + BucketPolicyOnly BucketPolicyOnly + CORS []CORS + Created time.Time + DefaultEventBasedHold bool + DefaultObjectACL []ACLRule + Encryption *BucketEncryption + Etag string + Labels map[string]string + Lifecycle Lifecycle + Location string + LocationType string + Logging *BucketLogging + MetaGeneration int64 + Name string + PredefinedACL string + PredefinedDefaultObjectACL string + RequesterPays bool + RetentionPolicy *RetentionPolicy + StorageClass string + VersioningEnabled bool + Website *BucketWebsite + type BucketAttrsToUpdate struct + BucketPolicyOnly *BucketPolicyOnly + CORS []CORS + DefaultEventBasedHold optional.Bool + Encryption *BucketEncryption + Lifecycle *Lifecycle + Logging *BucketLogging + PredefinedACL string + PredefinedDefaultObjectACL string + RequesterPays optional.Bool + RetentionPolicy *RetentionPolicy + VersioningEnabled optional.Bool + Website *BucketWebsite + func (ua *BucketAttrsToUpdate) DeleteLabel(name string) + func (ua *BucketAttrsToUpdate) SetLabel(name, value string) + type BucketConditions struct + MetagenerationMatch int64 + MetagenerationNotMatch int64 + type BucketEncryption struct + DefaultKMSKeyName string + type BucketHandle struct + func (b *BucketHandle) ACL() *ACLHandle + func (b *BucketHandle) AddNotification(ctx context.Context, n *Notification) (ret *Notification, err error) + func (b *BucketHandle) Attrs(ctx context.Context) (attrs *BucketAttrs, err error) + func (b *BucketHandle) Create(ctx context.Context, projectID string, attrs *BucketAttrs) (err error) + func (b *BucketHandle) DefaultObjectACL() *ACLHandle + func (b *BucketHandle) Delete(ctx context.Context) (err error) + func (b *BucketHandle) DeleteNotification(ctx context.Context, id string) (err error) + func (b *BucketHandle) IAM() *iam.Handle + func (b *BucketHandle) If(conds BucketConditions) *BucketHandle + func (b *BucketHandle) LockRetentionPolicy(ctx context.Context) error + func (b *BucketHandle) Notifications(ctx context.Context) (n map[string]*Notification, err error) + func (b *BucketHandle) Object(name string) *ObjectHandle + func (b *BucketHandle) Objects(ctx context.Context, q *Query) *ObjectIterator + func (b *BucketHandle) Update(ctx context.Context, uattrs BucketAttrsToUpdate) (attrs *BucketAttrs, err error) + func (b *BucketHandle) UserProject(projectID string) *BucketHandle + type BucketIterator struct + Prefix string + func (it *BucketIterator) Next() (*BucketAttrs, error) + func (it *BucketIterator) PageInfo() *iterator.PageInfo + type BucketLogging struct + LogBucket string + LogObjectPrefix string + type BucketPolicyOnly struct + Enabled bool + LockedTime time.Time + type BucketWebsite struct + MainPageSuffix string + NotFoundPage string + type CORS struct + MaxAge time.Duration + Methods []string + Origins []string + ResponseHeaders []string + type Client struct + func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) + func (c *Client) Bucket(name string) *BucketHandle + func (c *Client) Buckets(ctx context.Context, projectID string) *BucketIterator + func (c *Client) Close() error + func (c *Client) CreateHMACKey(ctx context.Context, projectID, serviceAccountEmail string) (*HMACKey, error) + func (c *Client) HMACKeyHandle(projectID, accessID string) *HMACKeyHandle + func (c *Client) ListHMACKeys(ctx context.Context, projectID string) *HMACKeysIterator + func (c *Client) ServiceAccount(ctx context.Context, projectID string) (string, error) + type Composer struct + func (c *Composer) Run(ctx context.Context) (attrs *ObjectAttrs, err error) + type Conditions struct + DoesNotExist bool + GenerationMatch int64 + GenerationNotMatch int64 + MetagenerationMatch int64 + MetagenerationNotMatch int64 + type Copier struct + DestinationKMSKeyName string + ProgressFunc func(copiedBytes, totalBytes uint64) + RewriteToken string + func (c *Copier) Run(ctx context.Context) (attrs *ObjectAttrs, err error) + type HMACKey struct + AccessID string + CreatedTime time.Time + Etag string + ID string + ProjectID string + Secret string + ServiceAccountEmail string + State HMACState + UpdatedTime time.Time + type HMACKeyAttrsToUpdate struct + Etag string + State HMACState + type HMACKeyHandle struct + func (h *HMACKeyHandle) Update(ctx context.Context, au HMACKeyAttrsToUpdate) (*HMACKey, error) + func (hkh *HMACKeyHandle) Delete(ctx context.Context) error + func (hkh *HMACKeyHandle) Get(ctx context.Context) (*HMACKey, error) + type HMACKeysIterator struct + func (it *HMACKeysIterator) Next() (*HMACKey, error) + func (it *HMACKeysIterator) PageInfo() *iterator.PageInfo + type HMACState string + const Active + const Deleted + const Inactive + type Lifecycle struct + Rules []LifecycleRule + type LifecycleAction struct + StorageClass string + Type string + type LifecycleCondition struct + AgeInDays int64 + CreatedBefore time.Time + Liveness Liveness + MatchesStorageClasses []string + NumNewerVersions int64 + type LifecycleRule struct + Action LifecycleAction + Condition LifecycleCondition + type Liveness int + const Archived + const Live + const LiveAndArchived + type Notification struct + CustomAttributes map[string]string + EventTypes []string + ID string + ObjectNamePrefix string + PayloadFormat string + TopicID string + TopicProjectID string + type ObjectAttrs struct + ACL []ACLRule + Bucket string + CRC32C uint32 + CacheControl string + ContentDisposition string + ContentEncoding string + ContentLanguage string + ContentType string + Created time.Time + CustomerKeySHA256 string + Deleted time.Time + Etag string + EventBasedHold bool + Generation int64 + KMSKeyName string + MD5 []byte + MediaLink string + Metadata map[string]string + Metageneration int64 + Name string + Owner string + PredefinedACL string + Prefix string + RetentionExpirationTime time.Time + Size int64 + StorageClass string + TemporaryHold bool + Updated time.Time + type ObjectAttrsToUpdate struct + ACL []ACLRule + CacheControl optional.String + ContentDisposition optional.String + ContentEncoding optional.String + ContentLanguage optional.String + ContentType optional.String + EventBasedHold optional.Bool + Metadata map[string]string + PredefinedACL string + TemporaryHold optional.Bool + type ObjectHandle struct + func (dst *ObjectHandle) ComposerFrom(srcs ...*ObjectHandle) *Composer + func (dst *ObjectHandle) CopierFrom(src *ObjectHandle) *Copier + func (o *ObjectHandle) ACL() *ACLHandle + func (o *ObjectHandle) Attrs(ctx context.Context) (attrs *ObjectAttrs, err error) + func (o *ObjectHandle) BucketName() string + func (o *ObjectHandle) Delete(ctx context.Context) error + func (o *ObjectHandle) Generation(gen int64) *ObjectHandle + func (o *ObjectHandle) If(conds Conditions) *ObjectHandle + func (o *ObjectHandle) Key(encryptionKey []byte) *ObjectHandle + func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) (r *Reader, err error) + func (o *ObjectHandle) NewReader(ctx context.Context) (*Reader, error) + func (o *ObjectHandle) NewWriter(ctx context.Context) *Writer + func (o *ObjectHandle) ObjectName() string + func (o *ObjectHandle) ReadCompressed(compressed bool) *ObjectHandle + func (o *ObjectHandle) Update(ctx context.Context, uattrs ObjectAttrsToUpdate) (oa *ObjectAttrs, err error) + type ObjectIterator struct + func (it *ObjectIterator) Next() (*ObjectAttrs, error) + func (it *ObjectIterator) PageInfo() *iterator.PageInfo + type ProjectTeam struct + ProjectNumber string + Team string + type Query struct + Delimiter string + Prefix string + Versions bool + type Reader struct + Attrs ReaderObjectAttrs + func (r *Reader) CacheControl() string + func (r *Reader) Close() error + func (r *Reader) ContentEncoding() string + func (r *Reader) ContentType() string + func (r *Reader) LastModified() (time.Time, error) + func (r *Reader) Read(p []byte) (int, error) + func (r *Reader) Remain() int64 + func (r *Reader) Size() int64 + type ReaderObjectAttrs struct + CacheControl string + ContentEncoding string + ContentType string + Generation int64 + LastModified time.Time + Metageneration int64 + Size int64 + StartOffset int64 + type RetentionPolicy struct + EffectiveTime time.Time + IsLocked bool + RetentionPeriod time.Duration + type SignedURLOptions struct + ContentType string + Expires time.Time + GoogleAccessID string + Headers []string + MD5 string + Method string + PrivateKey []byte + Scheme SigningScheme + SignBytes func([]byte) ([]byte, error) + type SigningScheme int + const SigningSchemeDefault + const SigningSchemeV2 + const SigningSchemeV4 + type Writer struct + ChunkSize int + ProgressFunc func(int64) + SendCRC32C bool + func (w *Writer) Attrs() *ObjectAttrs + func (w *Writer) Close() error + func (w *Writer) CloseWithError(err error) error + func (w *Writer) Write(p []byte) (n int, err error)