tracking

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentSchemaVersion string = "1"
	ProviderVersion      string = "v1.0.1" // TODO(SNOW-1814934): Currently hardcoded, make it computed
	MetadataPrefix       string = "terraform_provider_usage_tracking"
)

Variables

This section is empty.

Functions

func AppendMetadata

func AppendMetadata(sql string, metadata Metadata) (string, error)

func NewContext

func NewContext(ctx context.Context, metadata Metadata) context.Context

func TrimMetadata

func TrimMetadata(sql string) string

Types

type Metadata

type Metadata struct {
	SchemaVersion string    `json:"json_schema_version,omitempty"`
	Version       string    `json:"version,omitempty"`
	Resource      string    `json:"resource,omitempty"`
	Datasource    string    `json:"datasource,omitempty"`
	Operation     Operation `json:"operation,omitempty"`
}

func FromContext

func FromContext(ctx context.Context) (Metadata, bool)

func NewVersionedDatasourceMetadata

func NewVersionedDatasourceMetadata(datasource datasources.Datasource) Metadata

func NewVersionedResourceMetadata

func NewVersionedResourceMetadata(resource resources.Resource, operation Operation) Metadata

func ParseMetadata

func ParseMetadata(sql string) (Metadata, error)

type Operation

type Operation string
const (
	CreateOperation     Operation = "create"
	ReadOperation       Operation = "read"
	UpdateOperation     Operation = "update"
	DeleteOperation     Operation = "delete"
	ImportOperation     Operation = "import"
	CustomDiffOperation Operation = "custom_diff"
)

Jump to

Keyboard shortcuts

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