stream

package
v1.122.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IAMFormatPartialPolicy = "partialpolicy"
	IAMFormatPolicy        = "policy"
	IAMFormatPolicyMember  = "policymember"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetStream

type AssetStream interface {
	Next() (*asset.Asset, error)
	io.Closer
}

func NewFilteredAssetStream

func NewFilteredAssetStream(stream AssetStream, shouldInclude func(*asset.Asset) bool) AssetStream

Constructs a new asset stream with a filter function which determines if a given asset is included or not This is useful for filtering out asset types and resource types that we do not yet support

type AssetToUnstructuredResourceStream

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

func NewUnstructuredResourceStreamFromAssetStream

func NewUnstructuredResourceStreamFromAssetStream(assetStream AssetStream, client gcpclient.Client, tfProvider *schema.Provider, serviceClient serviceclient.ServiceClient, config *config.ControllerConfig) (*AssetToUnstructuredResourceStream, error)

NewUnstructuredResourceStreamFromAssetStream returns an unstructured stream. The stream converts each asset in the 'assetStream' to a KCC resource and does a GET request to GCP finally returning the current value of the resource in KCC format as an unstructured

func (*AssetToUnstructuredResourceStream) Next

type ByteStream

type ByteStream interface {
	Next(ctx context.Context) ([]byte, *unstructured.Unstructured, error)
}

func NewByteStream

func NewByteStream(resourceFormat outputsink.ResourceFormat, uStream UnstructuredStream, smLoader *servicemappingloader.ServiceMappingLoader, tfProvider *schema.Provider) (ByteStream, error)

type FilteredAssetStream

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

func (*FilteredAssetStream) Close

func (f *FilteredAssetStream) Close() error

func (*FilteredAssetStream) Next

func (f *FilteredAssetStream) Next() (*asset.Asset, error)

type HCLStream

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

func NewHCLStream

func NewHCLStream(unstructuredStream UnstructuredStream, smLoader *servicemappingloader.ServiceMappingLoader, tfProvider *schema.Provider) *HCLStream

func (*HCLStream) Next

type IAMClient

type IAMClient interface {
	SupportsIAM(unstructured *unstructured.Unstructured) (bool, error)
	GetPolicy(ctx context.Context, unstructured *unstructured.Unstructured) (*v1beta1.IAMPolicy, error)
}

type IAMFormat

type IAMFormat string

type RecoverableByteStream

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

RecoverableByteStream stream wraps a ByteStream and can recover from panics on Next(). It should be used to wrap the top level stream so that it can catch panics from any nested stream.

func NewRecoverableByteStream

func NewRecoverableByteStream(inputStream ByteStream) *RecoverableByteStream

func (*RecoverableByteStream) Next

func (s *RecoverableByteStream) Next(ctx context.Context) (bytes []byte, unstructured *unstructured.Unstructured, err error)

type URLToUnstructuredResourceStream

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

func NewUnstructuredResourceStreamFromURL

func NewUnstructuredResourceStreamFromURL(url string, provider *schema.Provider, smLoader *servicemappingloader.ServiceMappingLoader, gcpClient gcpclient.Client, httpClient *http.Client) *URLToUnstructuredResourceStream

func (*URLToUnstructuredResourceStream) Next

type UnstructuredResourceAndIAMPolicyStream

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

func NewUnstructuredResourceAndIAMPolicyStream

func NewUnstructuredResourceAndIAMPolicyStream(unstructuredStream UnstructuredStream, iamClient IAMClient, iamFormat IAMFormat, filterDeletedIAMMembers bool) *UnstructuredResourceAndIAMPolicyStream

func (*UnstructuredResourceAndIAMPolicyStream) Next

This function returns the next unstructured as follows: 1. If there at least one value in the iam resources slice, reduce the size of the slice by one and return the value at the head of the slice 2. Else, get the next resource, if it supports iam policy fetch the iam policy, if the policy is non-empty save it into the iam resources slice, then return the resource

type UnstructuredResourceFixupStream

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

UnstructuredResourceFixupStream will make any necessary edits to a resource to make sure it will work with K8s and KCC For example, ensuring the metadata.name is a K8s legal value (some GCP resource's allow values in 'name' with characters that are not allowed by K8s in metadata.name)

func NewUnstructuredResourceFixupStream

func NewUnstructuredResourceFixupStream(unstructuredStream UnstructuredStream) *UnstructuredResourceFixupStream

func (*UnstructuredResourceFixupStream) Next

type UnstructuredStream

type UnstructuredStream interface {
	Next(ctx context.Context) (*unstructured.Unstructured, error)
}

type YAMLStream

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

func NewYAMLStream

func NewYAMLStream(unstructuredStream UnstructuredStream) *YAMLStream

func (*YAMLStream) Next

Jump to

Keyboard shortcuts

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