provider

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MPL-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

func NewAppendResource

func NewAppendResource() resource.Resource

func NewExecTestDataSource added in v0.0.2

func NewExecTestDataSource() datasource.DataSource

func NewGetFunction added in v0.0.13

func NewGetFunction() function.Function

func NewParseFunction added in v0.0.13

func NewParseFunction() function.Function

func NewStructureTestDataSource added in v0.0.2

func NewStructureTestDataSource() datasource.DataSource

func NewTagResource

func NewTagResource() resource.Resource

func NewTagsResource added in v0.0.9

func NewTagsResource() resource.Resource

Types

type AppendResource

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

AppendResource defines the resource implementation.

func (*AppendResource) Configure

func (*AppendResource) Create

func (*AppendResource) Delete

func (*AppendResource) ImportState

func (*AppendResource) Metadata

func (*AppendResource) Read

func (*AppendResource) Schema

func (*AppendResource) Update

type AppendResourceModel

type AppendResourceModel struct {
	Id       types.String `tfsdk:"id"`
	ImageRef types.String `tfsdk:"image_ref"`

	BaseImage types.String `tfsdk:"base_image"`
	Layers    types.List   `tfsdk:"layers"`
}

AppendResourceModel describes the resource data model.

type Config

type Config struct {
	Env        []string `tfsdk:"env"`
	User       string   `tfsdk:"user"`
	WorkingDir string   `tfsdk:"working_dir"`
	Entrypoint []string `tfsdk:"entrypoint"`
	Cmd        []string `tfsdk:"cmd"`
	CreatedAt  string   `tfsdk:"created_at"`
}

func (*Config) FromConfigFile

func (c *Config) FromConfigFile(cf *v1.ConfigFile)

type Descriptor

type Descriptor struct {
	MediaType string    `tfsdk:"media_type"`
	Size      int64     `tfsdk:"size"`
	Digest    string    `tfsdk:"digest"`
	Platform  *Platform `tfsdk:"platform"`
}

func ToDescriptor

func ToDescriptor(d *v1.Descriptor) *Descriptor

func ToDescriptors

func ToDescriptors(d []v1.Descriptor) []Descriptor

type EnvVar added in v0.0.5

type EnvVar struct {
	Name  string `tfsdk:"name"`
	Value string `tfsdk:"value"`
}

type ExecTestDataSource added in v0.0.2

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

ExecTestDataSource defines the data source implementation.

func (*ExecTestDataSource) Configure added in v0.0.2

func (*ExecTestDataSource) Metadata added in v0.0.2

func (*ExecTestDataSource) Read added in v0.0.2

func (*ExecTestDataSource) Schema added in v0.0.2

type ExecTestDataSourceModel added in v0.0.2

type ExecTestDataSourceModel struct {
	Digest         types.String `tfsdk:"digest"`
	Script         types.String `tfsdk:"script"`
	TimeoutSeconds types.Int64  `tfsdk:"timeout_seconds"`
	WorkingDir     types.String `tfsdk:"working_dir"`
	Env            []EnvVar     `tfsdk:"env"`

	ExitCode  types.Int64  `tfsdk:"exit_code"`
	Output    types.String `tfsdk:"output"`
	Id        types.String `tfsdk:"id"`
	TestedRef types.String `tfsdk:"tested_ref"`
}

ExecTestDataSourceModel describes the data source data model.

type GetFunction added in v0.0.13

type GetFunction struct{}

GetFunction defines the function implementation.

func (*GetFunction) Definition added in v0.0.13

Definition should return the definition for the function.

func (*GetFunction) Metadata added in v0.0.13

Metadata should return the name of the function, such as parse_xyz.

func (*GetFunction) Run added in v0.0.13

Run should return the result of the function logic. It is called when Terraform reaches a function call in the configuration. Argument data values should be read from the [RunRequest] and the result value set in the [RunResponse].

type Image

type Image struct {
	Digest   string `tfsdk:"digest"`
	ImageRef string `tfsdk:"image_ref"`
}

type Manifest

type Manifest struct {
	SchemaVersion int64             `tfsdk:"schema_version"`
	MediaType     string            `tfsdk:"media_type"`
	Config        *Descriptor       `tfsdk:"config"`
	Layers        []Descriptor      `tfsdk:"layers"`
	Annotations   map[string]string `tfsdk:"annotations"`
	Manifests     []Descriptor      `tfsdk:"manifests"`
	Subject       *Descriptor       `tfsdk:"subject"`
}

func (*Manifest) FromDescriptor

func (m *Manifest) FromDescriptor(desc *remote.Descriptor) error

type OCIProvider

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

OCIProvider defines the provider implementation.

func (*OCIProvider) Configure

func (*OCIProvider) DataSources

func (p *OCIProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*OCIProvider) Functions added in v0.0.13

func (p *OCIProvider) Functions(ctx context.Context) []func() function.Function

func (*OCIProvider) Metadata

func (*OCIProvider) Resources

func (p *OCIProvider) Resources(ctx context.Context) []func() resource.Resource

func (*OCIProvider) Schema

type OCIProviderModel

type OCIProviderModel struct {
	DefaultExecTimeoutSeconds *int64 `tfsdk:"default_exec_timeout_seconds"`
}

OCIProviderModel describes the provider data model.

type ParseFunction added in v0.0.13

type ParseFunction struct{}

ParseFunction defines the function implementation.

func (*ParseFunction) Definition added in v0.0.13

Definition should return the definition for the function.

func (*ParseFunction) Metadata added in v0.0.13

Metadata should return the name of the function, such as parse_xyz.

func (*ParseFunction) Run added in v0.0.13

Run should return the result of the function logic. It is called when Terraform reaches a function call in the configuration. Argument data values should be read from the [RunRequest] and the result value set in the [RunResponse].

type Platform

type Platform struct {
	Architecture string `tfsdk:"architecture"`
	OS           string `tfsdk:"os"`
	Variant      string `tfsdk:"variant"`
	OSVersion    string `tfsdk:"os_version"`
}

func ToPlatform

func ToPlatform(p *v1.Platform) *Platform

type ProviderOpts added in v0.0.5

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

type StructureTestDataSource added in v0.0.2

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

StructureTestDataSource defines the data source implementation.

func (*StructureTestDataSource) Configure added in v0.0.2

func (*StructureTestDataSource) Metadata added in v0.0.2

func (*StructureTestDataSource) Read added in v0.0.2

func (*StructureTestDataSource) Schema added in v0.0.2

type StructureTestDataSourceModel added in v0.0.2

type StructureTestDataSourceModel struct {
	Digest     types.String `tfsdk:"digest"`
	Conditions []struct {
		Env []struct {
			Key   types.String `tfsdk:"key"`
			Value types.String `tfsdk:"value"`
		} `tfsdk:"env"`
		Files []struct {
			Path  types.String `tfsdk:"path"`
			Regex types.String `tfsdk:"regex"`
		} `tfsdk:"files"`
	} `tfsdk:"conditions"`

	Id        types.String `tfsdk:"id"`
	TestedRef types.String `tfsdk:"tested_ref"`
}

StructureTestDataSourceModel describes the data source data model.

type TagResource

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

TagResource defines the resource implementation.

func (*TagResource) Configure

func (*TagResource) Create

func (*TagResource) Delete

func (*TagResource) ImportState

func (*TagResource) Metadata

func (*TagResource) Read

func (*TagResource) Schema

func (*TagResource) Update

type TagResourceModel

type TagResourceModel struct {
	Id        types.String `tfsdk:"id"`
	TaggedRef types.String `tfsdk:"tagged_ref"`

	DigestRef types.String `tfsdk:"digest_ref"`
	Tag       types.String `tfsdk:"tag"`
}

TagResourceModel describes the resource data model.

type TagsResource added in v0.0.9

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

TagsResource defines the resource implementation.

func (*TagsResource) Configure added in v0.0.9

func (*TagsResource) Create added in v0.0.9

func (*TagsResource) Delete added in v0.0.9

func (*TagsResource) ImportState added in v0.0.9

func (*TagsResource) Metadata added in v0.0.9

func (*TagsResource) Read added in v0.0.9

func (*TagsResource) Schema added in v0.0.9

func (*TagsResource) Update added in v0.0.9

type TagsResourceModel added in v0.0.9

type TagsResourceModel struct {
	Id types.String `tfsdk:"id"`

	Repo string            `tfsdk:"repo"`
	Tags map[string]string `tfsdk:"tags"` // tag -> digest
}

TagsResourceModel describes the resource data model.

Jump to

Keyboard shortcuts

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