Documentation ¶
Overview ¶
Copyright 2022 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 firebaserules defines operations in the declarative SDK.
Copyright 2022 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 2022 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 2022 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 2022 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 firebaserules provides Utilities for Firebase Rules custom overrides.
Copyright 2022 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 2022 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 2022 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.
Index ¶
- Constants
- Variables
- func DCLReleaseSchema() *dcl.Schema
- func DCLRulesetSchema() *dcl.Schema
- func EncodeReleaseUpdateRequest(m map[string]interface{}) map[string]interface{}
- type Client
- func (c *Client) ApplyRelease(ctx context.Context, rawDesired *Release, opts ...dcl.ApplyOption) (*Release, error)
- func (c *Client) ApplyRuleset(ctx context.Context, rawDesired *Ruleset, opts ...dcl.ApplyOption) (*Ruleset, error)
- func (c *Client) DeleteAllRelease(ctx context.Context, project string, filter func(*Release) bool) error
- func (c *Client) DeleteAllRuleset(ctx context.Context, project string, filter func(*Ruleset) bool) error
- func (c *Client) DeleteRelease(ctx context.Context, r *Release) error
- func (c *Client) DeleteRuleset(ctx context.Context, r *Ruleset) error
- func (c *Client) GetRelease(ctx context.Context, r *Release) (*Release, error)
- func (c *Client) GetRuleset(ctx context.Context, r *Ruleset) (*Ruleset, error)
- func (c *Client) ListRelease(ctx context.Context, project string) (*ReleaseList, error)
- func (c *Client) ListReleaseWithMaxResults(ctx context.Context, project string, pageSize int32) (*ReleaseList, error)
- func (c *Client) ListRuleset(ctx context.Context, project string) (*RulesetList, error)
- func (c *Client) ListRulesetWithMaxResults(ctx context.Context, project string, pageSize int32) (*RulesetList, error)
- type Release
- type ReleaseList
- type Ruleset
- type RulesetList
- type RulesetMetadata
- type RulesetSource
- type RulesetSourceFiles
- type RulesetSourceLanguageEnum
Constants ¶
const ReleaseMaxPage = -1
const RulesetMaxPage = -1
Variables ¶
var YAML_release = []byte("info:\n title: Firebaserules/Release\n description: \"\"\n x-dcl-struct-name: Release\n x-dcl-has-iam: false\n x-dcl-ref:\n text: Firebase Rules API Documentation\n url: https://firebase.google.com/docs/reference/rules/rest#rest-resource:-v1.projects.releases\n x-dcl-guides:\n - text: Get started with Firebase Security Rules\n url: https://firebase.google.com/docs/rules/get-started\npaths:\n get:\n description: The function used to get information about a Release\n parameters:\n - name: Release\n required: true\n description: A full instance of a Release\n apply:\n description: The function used to apply information about a Release\n parameters:\n - name: Release\n required: true\n description: A full instance of a Release\n delete:\n description: The function used to delete a Release\n parameters:\n - name: Release\n required: true\n description: A full instance of a Release\n deleteAll:\n description: The function used to delete all Release\n parameters:\n - name: project\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many Release\n parameters:\n - name: project\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n Release:\n title: Release\n x-dcl-id: projects/{{project}}/releases/{{name}}\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: false\n type: object\n required:\n - name\n - rulesetName\n - project\n properties:\n createTime:\n type: string\n format: date-time\n x-dcl-go-name: CreateTime\n readOnly: true\n description: Output only. Time the release was created.\n x-kubernetes-immutable: true\n disabled:\n type: boolean\n x-dcl-go-name: Disabled\n readOnly: true\n description: Disable the release to keep it from being served. The response\n code of NOT_FOUND will be given for executables generated from this Release.\n x-kubernetes-immutable: true\n name:\n type: string\n x-dcl-go-name: Name\n description: 'Format: `projects/{project_id}/releases/{release_id}`\\Firestore\n Rules Releases will **always** have the name ''cloud.firestore'''\n x-kubernetes-immutable: true\n x-dcl-forward-slash-allowed: true\n project:\n type: string\n x-dcl-go-name: Project\n description: The project for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n rulesetName:\n type: string\n x-dcl-go-name: RulesetName\n description: Name of the `Ruleset` referred to by this `Release`. The `Ruleset`\n must exist for the `Release` to be created.\n x-dcl-references:\n - resource: Firebaserules/Ruleset\n field: name\n updateTime:\n type: string\n format: date-time\n x-dcl-go-name: UpdateTime\n readOnly: true\n description: Output only. Time the release was updated.\n x-kubernetes-immutable: true\n")
blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/firebaserules/release.yaml
var YAML_ruleset = []byte("info:\n title: Firebaserules/Ruleset\n description: \"\"\n x-dcl-struct-name: Ruleset\n x-dcl-has-iam: false\n x-dcl-ref:\n text: Firebase Ruleset API Documentation\n url: https://firebase.google.com/docs/reference/rules/rest#rest-resource:-v1.projects.rulesets\n x-dcl-guides:\n - text: Get started with Firebase Security Rules\n url: https://firebase.google.com/docs/rules/get-started\npaths:\n get:\n description: The function used to get information about a Ruleset\n parameters:\n - name: Ruleset\n required: true\n description: A full instance of a Ruleset\n apply:\n description: The function used to apply information about a Ruleset\n parameters:\n - name: Ruleset\n required: true\n description: A full instance of a Ruleset\n delete:\n description: The function used to delete a Ruleset\n parameters:\n - name: Ruleset\n required: true\n description: A full instance of a Ruleset\n deleteAll:\n description: The function used to delete all Ruleset\n parameters:\n - name: project\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many Ruleset\n parameters:\n - name: project\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n Ruleset:\n title: Ruleset\n x-dcl-id: projects/{{project}}/rulesets/{{name}}\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: false\n type: object\n required:\n - source\n - project\n properties:\n createTime:\n type: string\n format: date-time\n x-dcl-go-name: CreateTime\n readOnly: true\n description: Output only. Time the `Ruleset` was created.\n x-kubernetes-immutable: true\n metadata:\n type: object\n x-dcl-go-name: Metadata\n x-dcl-go-type: RulesetMetadata\n readOnly: true\n description: Output only. The metadata for this ruleset.\n x-kubernetes-immutable: true\n properties:\n services:\n type: array\n x-dcl-go-name: Services\n description: Services that this ruleset has declarations for (e.g.,\n \"cloud.firestore\"). There may be 0+ of these.\n x-kubernetes-immutable: true\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: string\n name:\n type: string\n x-dcl-go-name: Name\n description: 'Output only. Name of the `Ruleset`. The ruleset_id is auto\n generated by the service. Format: `projects/{project_id}/rulesets/{ruleset_id}`'\n x-kubernetes-immutable: true\n x-dcl-server-generated-parameter: true\n project:\n type: string\n x-dcl-go-name: Project\n description: The project for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n source:\n type: object\n x-dcl-go-name: Source\n x-dcl-go-type: RulesetSource\n description: '`Source` for the `Ruleset`.'\n x-kubernetes-immutable: true\n required:\n - files\n properties:\n files:\n type: array\n x-dcl-go-name: Files\n description: '`File` set constituting the `Source` bundle.'\n x-kubernetes-immutable: true\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: object\n x-dcl-go-type: RulesetSourceFiles\n required:\n - content\n - name\n properties:\n content:\n type: string\n x-dcl-go-name: Content\n description: Textual Content.\n x-kubernetes-immutable: true\n fingerprint:\n type: string\n x-dcl-go-name: Fingerprint\n description: Fingerprint (e.g. github sha) associated with the\n `File`.\n x-kubernetes-immutable: true\n name:\n type: string\n x-dcl-go-name: Name\n description: File name.\n x-kubernetes-immutable: true\n language:\n type: string\n x-dcl-go-name: Language\n x-dcl-go-type: RulesetSourceLanguageEnum\n description: '`Language` of the `Source` bundle. If unspecified, the\n language will default to `FIREBASE_RULES`. Possible values: LANGUAGE_UNSPECIFIED,\n FIREBASE_RULES, EVENT_FLOW_TRIGGERS'\n x-kubernetes-immutable: true\n enum:\n - LANGUAGE_UNSPECIFIED\n - FIREBASE_RULES\n - EVENT_FLOW_TRIGGERS\n")
blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/firebaserules/ruleset.yaml
Functions ¶
func DCLReleaseSchema ¶ added in v1.10.3
func DCLRulesetSchema ¶ added in v1.10.3
func EncodeReleaseUpdateRequest ¶
EncodeReleaseUpdateRequest encapsulates fields in a release {} block, as expected by https://firebase.google.com/docs/reference/rules/rest/v1/projects.releases/patch
Types ¶
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) ApplyRelease ¶
func (*Client) ApplyRuleset ¶
func (*Client) DeleteAllRelease ¶
func (c *Client) DeleteAllRelease(ctx context.Context, project string, filter func(*Release) bool) error
DeleteAllRelease deletes all resources that the filter functions returns true on.
func (*Client) DeleteAllRuleset ¶
func (c *Client) DeleteAllRuleset(ctx context.Context, project string, filter func(*Ruleset) bool) error
DeleteAllRuleset deletes all resources that the filter functions returns true on.
func (*Client) DeleteRelease ¶
func (*Client) DeleteRuleset ¶
func (*Client) GetRelease ¶
func (*Client) GetRuleset ¶
func (*Client) ListRelease ¶
func (*Client) ListReleaseWithMaxResults ¶
func (*Client) ListRuleset ¶
func (*Client) ListRulesetWithMaxResults ¶
type Release ¶
type Release struct { Name *string `json:"name"` RulesetName *string `json:"rulesetName"` CreateTime *string `json:"createTime"` UpdateTime *string `json:"updateTime"` Disabled *bool `json:"disabled"` Project *string `json:"project"` }
func (*Release) Describe ¶
func (r *Release) Describe() dcl.ServiceTypeVersion
Describe returns a simple description of this resource to ensure that automated tools can identify it.
type ReleaseList ¶
type ReleaseList struct { Items []*Release // contains filtered or unexported fields }
func (*ReleaseList) HasNext ¶
func (l *ReleaseList) HasNext() bool
type Ruleset ¶
type Ruleset struct { Name *string `json:"name"` Source *RulesetSource `json:"source"` CreateTime *string `json:"createTime"` Metadata *RulesetMetadata `json:"metadata"` Project *string `json:"project"` }
func (*Ruleset) Describe ¶
func (r *Ruleset) Describe() dcl.ServiceTypeVersion
Describe returns a simple description of this resource to ensure that automated tools can identify it.
type RulesetList ¶
type RulesetList struct { Items []*Ruleset // contains filtered or unexported fields }
func (*RulesetList) HasNext ¶
func (l *RulesetList) HasNext() bool
type RulesetMetadata ¶
type RulesetMetadata struct { Services []string `json:"services"` // contains filtered or unexported fields }
var EmptyRulesetMetadata *RulesetMetadata = &RulesetMetadata{empty: true}
This object is used to assert a desired state where this RulesetMetadata is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*RulesetMetadata) Empty ¶
func (r *RulesetMetadata) Empty() bool
func (*RulesetMetadata) HashCode ¶
func (r *RulesetMetadata) HashCode() string
func (*RulesetMetadata) String ¶
func (r *RulesetMetadata) String() string
func (*RulesetMetadata) UnmarshalJSON ¶
func (r *RulesetMetadata) UnmarshalJSON(data []byte) error
type RulesetSource ¶
type RulesetSource struct { Files []RulesetSourceFiles `json:"files"` Language *RulesetSourceLanguageEnum `json:"language"` // contains filtered or unexported fields }
var EmptyRulesetSource *RulesetSource = &RulesetSource{empty: true}
This object is used to assert a desired state where this RulesetSource is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*RulesetSource) Empty ¶
func (r *RulesetSource) Empty() bool
func (*RulesetSource) HashCode ¶
func (r *RulesetSource) HashCode() string
func (*RulesetSource) String ¶
func (r *RulesetSource) String() string
func (*RulesetSource) UnmarshalJSON ¶
func (r *RulesetSource) UnmarshalJSON(data []byte) error
type RulesetSourceFiles ¶
type RulesetSourceFiles struct { Content *string `json:"content"` Name *string `json:"name"` Fingerprint *string `json:"fingerprint"` // contains filtered or unexported fields }
var EmptyRulesetSourceFiles *RulesetSourceFiles = &RulesetSourceFiles{empty: true}
This object is used to assert a desired state where this RulesetSourceFiles is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*RulesetSourceFiles) Empty ¶
func (r *RulesetSourceFiles) Empty() bool
func (*RulesetSourceFiles) HashCode ¶
func (r *RulesetSourceFiles) HashCode() string
func (*RulesetSourceFiles) String ¶
func (r *RulesetSourceFiles) String() string
func (*RulesetSourceFiles) UnmarshalJSON ¶
func (r *RulesetSourceFiles) UnmarshalJSON(data []byte) error
type RulesetSourceLanguageEnum ¶
type RulesetSourceLanguageEnum string
The enum RulesetSourceLanguageEnum.
func RulesetSourceLanguageEnumRef ¶
func RulesetSourceLanguageEnumRef(s string) *RulesetSourceLanguageEnum
RulesetSourceLanguageEnumRef returns a *RulesetSourceLanguageEnum with the value of string s If the empty string is provided, nil is returned.
func (RulesetSourceLanguageEnum) Validate ¶
func (v RulesetSourceLanguageEnum) Validate() error