provider

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVarMissing = errors.New("variable missing")
)

Transport errors.

Functions

func MakeHandler

func MakeHandler(svc Service, auth endpoint.Middleware, options ...httptransport.ServerOption) http.Handler

MakeHandler returns a fully initialized http.Handler.

Types

type Middleware

type Middleware func(Service) Service

Middleware is a Service middleware.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware is a logging Service middleware.

type Service

type Service interface {
	GetProvider(ctx context.Context, namespace, name, version, os, arch string) (core.Provider, error)
	ListProviderVersions(ctx context.Context, namespace, name string) ([]core.ProviderVersion, error)
}

Service implements the Provider Registry Protocol. For more information see: https://www.terraform.io/docs/internals/provider-registry-protocol.html.

func NewService

func NewService(storage Storage) Service

NewService returns a fully initialized Service.

type Storage

type Storage interface {
	GetProvider(ctx context.Context, namespace, name, version, os, arch string) (core.Provider, error)
	ListProviderVersions(ctx context.Context, namespace, name string) ([]core.ProviderVersion, error)

	// UploadProviderReleaseFiles is used to upload all artifacts which make up a provider release
	// https://developer.hashicorp.com/terraform/registry/providers/publishing#manually-preparing-a-release
	UploadProviderReleaseFiles(ctx context.Context, namespace, name, filename string, file io.Reader) error

	// SigningKeys downloads and returns the keys for a given namespace from the configured storage backend
	SigningKeys(ctx context.Context, namespace string) (*core.SigningKeys, error)

	// MigrateProviders is needed for the migration from 0.7.0 to 0.8.0
	MigrateProviders(ctx context.Context, logger log.Logger, dryRun bool) error
}

Storage represents the Storage of Terraform providers.

Jump to

Keyboard shortcuts

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