Documentation
¶
Overview ¶
Copyright 2026 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2026 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2026 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2026 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2026 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package storage defines operations in the declarative SDK.
Copyright 2026 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package storage contains handwritten support code for the storage service.
Index ¶
- Constants
- Variables
- func DCLBucketSchema() *dcl.Schema
- type Bucket
- func (r *Bucket) Describe() dcl.ServiceTypeVersion
- func (r *Bucket) GetPolicy(basePath string) (string, string, *bytes.Buffer, error)
- func (r *Bucket) IAMPolicyVersion() int
- func (r *Bucket) ID() (string, error)
- func (r *Bucket) SetPolicyURL(userBasePath string) string
- func (r *Bucket) SetPolicyVerb() string
- func (r *Bucket) String() string
- type BucketCors
- type BucketLifecycle
- type BucketLifecycleRule
- type BucketLifecycleRuleAction
- type BucketLifecycleRuleActionTypeEnum
- type BucketLifecycleRuleCondition
- type BucketLifecycleRuleConditionWithStateEnum
- type BucketList
- type BucketLogging
- type BucketStorageClassEnum
- type BucketVersioning
- type BucketWebsite
- type Client
- func (c *Client) ApplyBucket(ctx context.Context, rawDesired *Bucket, opts ...dcl.ApplyOption) (*Bucket, error)
- func (c *Client) DeleteAllBucket(ctx context.Context, project string, filter func(*Bucket) bool) error
- func (c *Client) DeleteBucket(ctx context.Context, r *Bucket) error
- func (c *Client) GetBucket(ctx context.Context, r *Bucket) (*Bucket, error)
- func (c *Client) ListBucket(ctx context.Context, project string) (*BucketList, error)
- func (c *Client) ListBucketWithMaxResults(ctx context.Context, project string, pageSize int32) (*BucketList, error)
Constants ¶
const BucketMaxPage = -1
Variables ¶
var YAML_bucket []byte
Functions ¶
func DCLBucketSchema ¶ added in v1.10.3
Types ¶
type Bucket ¶
type Bucket struct {
Project *string `json:"project"`
Location *string `json:"location"`
Name *string `json:"name"`
Cors []BucketCors `json:"cors"`
Lifecycle *BucketLifecycle `json:"lifecycle"`
Logging *BucketLogging `json:"logging"`
StorageClass *BucketStorageClassEnum `json:"storageClass"`
Versioning *BucketVersioning `json:"versioning"`
Website *BucketWebsite `json:"website"`
}
func (*Bucket) Describe ¶
func (r *Bucket) Describe() dcl.ServiceTypeVersion
Describe returns a simple description of this resource to ensure that automated tools can identify it.
func (*Bucket) IAMPolicyVersion ¶
func (*Bucket) SetPolicyURL ¶
func (*Bucket) SetPolicyVerb ¶
type BucketCors ¶
type BucketCors struct {
MaxAgeSeconds *int64 `json:"maxAgeSeconds"`
Method []string `json:"method"`
Origin []string `json:"origin"`
ResponseHeader []string `json:"responseHeader"`
// contains filtered or unexported fields
}
var EmptyBucketCors *BucketCors = &BucketCors{empty: true}
This object is used to assert a desired state where this BucketCors is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BucketCors) Empty ¶
func (r *BucketCors) Empty() bool
func (*BucketCors) HashCode ¶
func (r *BucketCors) HashCode() string
func (*BucketCors) String ¶
func (r *BucketCors) String() string
func (*BucketCors) UnmarshalJSON ¶
func (r *BucketCors) UnmarshalJSON(data []byte) error
type BucketLifecycle ¶
type BucketLifecycle struct {
Rule []BucketLifecycleRule `json:"rule"`
// contains filtered or unexported fields
}
var EmptyBucketLifecycle *BucketLifecycle = &BucketLifecycle{empty: true}
This object is used to assert a desired state where this BucketLifecycle is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BucketLifecycle) Empty ¶
func (r *BucketLifecycle) Empty() bool
func (*BucketLifecycle) HashCode ¶
func (r *BucketLifecycle) HashCode() string
func (*BucketLifecycle) String ¶
func (r *BucketLifecycle) String() string
func (*BucketLifecycle) UnmarshalJSON ¶
func (r *BucketLifecycle) UnmarshalJSON(data []byte) error
type BucketLifecycleRule ¶
type BucketLifecycleRule struct {
Action *BucketLifecycleRuleAction `json:"action"`
Condition *BucketLifecycleRuleCondition `json:"condition"`
// contains filtered or unexported fields
}
var EmptyBucketLifecycleRule *BucketLifecycleRule = &BucketLifecycleRule{empty: true}
This object is used to assert a desired state where this BucketLifecycleRule is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BucketLifecycleRule) Empty ¶
func (r *BucketLifecycleRule) Empty() bool
func (*BucketLifecycleRule) HashCode ¶
func (r *BucketLifecycleRule) HashCode() string
func (*BucketLifecycleRule) String ¶
func (r *BucketLifecycleRule) String() string
func (*BucketLifecycleRule) UnmarshalJSON ¶
func (r *BucketLifecycleRule) UnmarshalJSON(data []byte) error
type BucketLifecycleRuleAction ¶
type BucketLifecycleRuleAction struct {
StorageClass *string `json:"storageClass"`
Type *BucketLifecycleRuleActionTypeEnum `json:"type"`
// contains filtered or unexported fields
}
var EmptyBucketLifecycleRuleAction *BucketLifecycleRuleAction = &BucketLifecycleRuleAction{empty: true}
This object is used to assert a desired state where this BucketLifecycleRuleAction is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BucketLifecycleRuleAction) Empty ¶
func (r *BucketLifecycleRuleAction) Empty() bool
func (*BucketLifecycleRuleAction) HashCode ¶
func (r *BucketLifecycleRuleAction) HashCode() string
func (*BucketLifecycleRuleAction) String ¶
func (r *BucketLifecycleRuleAction) String() string
func (*BucketLifecycleRuleAction) UnmarshalJSON ¶
func (r *BucketLifecycleRuleAction) UnmarshalJSON(data []byte) error
type BucketLifecycleRuleActionTypeEnum ¶
type BucketLifecycleRuleActionTypeEnum string
The enum BucketLifecycleRuleActionTypeEnum.
func BucketLifecycleRuleActionTypeEnumRef ¶
func BucketLifecycleRuleActionTypeEnumRef(s string) *BucketLifecycleRuleActionTypeEnum
BucketLifecycleRuleActionTypeEnumRef returns a *BucketLifecycleRuleActionTypeEnum with the value of string s If the empty string is provided, nil is returned.
func (BucketLifecycleRuleActionTypeEnum) Validate ¶
func (v BucketLifecycleRuleActionTypeEnum) Validate() error
type BucketLifecycleRuleCondition ¶
type BucketLifecycleRuleCondition struct {
Age *int64 `json:"age"`
CreatedBefore *string `json:"createdBefore"`
WithState *BucketLifecycleRuleConditionWithStateEnum `json:"withState"`
MatchesStorageClass []string `json:"matchesStorageClass"`
NumNewerVersions *int64 `json:"numNewerVersions"`
// contains filtered or unexported fields
}
var EmptyBucketLifecycleRuleCondition *BucketLifecycleRuleCondition = &BucketLifecycleRuleCondition{empty: true}
This object is used to assert a desired state where this BucketLifecycleRuleCondition is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BucketLifecycleRuleCondition) Empty ¶
func (r *BucketLifecycleRuleCondition) Empty() bool
func (*BucketLifecycleRuleCondition) HashCode ¶
func (r *BucketLifecycleRuleCondition) HashCode() string
func (*BucketLifecycleRuleCondition) String ¶
func (r *BucketLifecycleRuleCondition) String() string
func (*BucketLifecycleRuleCondition) UnmarshalJSON ¶
func (r *BucketLifecycleRuleCondition) UnmarshalJSON(data []byte) error
type BucketLifecycleRuleConditionWithStateEnum ¶
type BucketLifecycleRuleConditionWithStateEnum string
The enum BucketLifecycleRuleConditionWithStateEnum.
func BucketLifecycleRuleConditionWithStateEnumRef ¶
func BucketLifecycleRuleConditionWithStateEnumRef(s string) *BucketLifecycleRuleConditionWithStateEnum
BucketLifecycleRuleConditionWithStateEnumRef returns a *BucketLifecycleRuleConditionWithStateEnum with the value of string s If the empty string is provided, nil is returned.
func (BucketLifecycleRuleConditionWithStateEnum) Validate ¶
func (v BucketLifecycleRuleConditionWithStateEnum) Validate() error
type BucketList ¶
type BucketList struct {
Items []*Bucket
// contains filtered or unexported fields
}
func (*BucketList) HasNext ¶
func (l *BucketList) HasNext() bool
type BucketLogging ¶
type BucketLogging struct {
LogBucket *string `json:"logBucket"`
LogObjectPrefix *string `json:"logObjectPrefix"`
// contains filtered or unexported fields
}
var EmptyBucketLogging *BucketLogging = &BucketLogging{empty: true}
This object is used to assert a desired state where this BucketLogging is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BucketLogging) Empty ¶
func (r *BucketLogging) Empty() bool
func (*BucketLogging) HashCode ¶
func (r *BucketLogging) HashCode() string
func (*BucketLogging) String ¶
func (r *BucketLogging) String() string
func (*BucketLogging) UnmarshalJSON ¶
func (r *BucketLogging) UnmarshalJSON(data []byte) error
type BucketStorageClassEnum ¶
type BucketStorageClassEnum string
The enum BucketStorageClassEnum.
func BucketStorageClassEnumRef ¶
func BucketStorageClassEnumRef(s string) *BucketStorageClassEnum
BucketStorageClassEnumRef returns a *BucketStorageClassEnum with the value of string s If the empty string is provided, nil is returned.
func (BucketStorageClassEnum) Validate ¶
func (v BucketStorageClassEnum) Validate() error
type BucketVersioning ¶
type BucketVersioning struct {
Enabled *bool `json:"enabled"`
// contains filtered or unexported fields
}
var EmptyBucketVersioning *BucketVersioning = &BucketVersioning{empty: true}
This object is used to assert a desired state where this BucketVersioning is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BucketVersioning) Empty ¶
func (r *BucketVersioning) Empty() bool
func (*BucketVersioning) HashCode ¶
func (r *BucketVersioning) HashCode() string
func (*BucketVersioning) String ¶
func (r *BucketVersioning) String() string
func (*BucketVersioning) UnmarshalJSON ¶
func (r *BucketVersioning) UnmarshalJSON(data []byte) error
type BucketWebsite ¶
type BucketWebsite struct {
MainPageSuffix *string `json:"mainPageSuffix"`
NotFoundPage *string `json:"notFoundPage"`
// contains filtered or unexported fields
}
var EmptyBucketWebsite *BucketWebsite = &BucketWebsite{empty: true}
This object is used to assert a desired state where this BucketWebsite is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BucketWebsite) Empty ¶
func (r *BucketWebsite) Empty() bool
func (*BucketWebsite) HashCode ¶
func (r *BucketWebsite) HashCode() string
func (*BucketWebsite) String ¶
func (r *BucketWebsite) String() string
func (*BucketWebsite) UnmarshalJSON ¶
func (r *BucketWebsite) UnmarshalJSON(data []byte) error
type Client ¶
The Client is the base struct of all operations. This will receive the Get, Delete, List, and Apply operations on all resources.
func (*Client) ApplyBucket ¶
func (*Client) DeleteAllBucket ¶
func (c *Client) DeleteAllBucket(ctx context.Context, project string, filter func(*Bucket) bool) error
DeleteAllBucket deletes all resources that the filter functions returns true on.