provider

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Provider errors
	ErrProviderNotFound = errors.New("failed to locate provider")
)

Functions

func ErrorEncoder

func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)

ErrorEncoder translates domain specific errors to HTTP status codes

func MakeHandler

func MakeHandler(svc Service, auth endpoint.Middleware, metrics *o11y.ProviderMetrics, instrumentation o11y.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() 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.ProviderVersions, 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.ProviderVersions, 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)
}

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