providerregistry

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package providerregistry package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateProviderInput

type CreateProviderInput struct {
	Name          string
	GroupID       string
	RepositoryURL string
	Private       bool
}

CreateProviderInput is the input for creating a terraform provider

type CreateProviderPlatformInput

type CreateProviderPlatformInput struct {
	ProviderVersionID string
	OperatingSystem   string
	Architecture      string
	SHASum            string
	Filename          string
}

CreateProviderPlatformInput is the input for creating a terraform provider platform

type CreateProviderVersionInput

type CreateProviderVersionInput struct {
	SemanticVersion string
	ProviderID      string
	Protocols       []string
}

CreateProviderVersionInput is the input for creating a terraform provider version

type GetProviderPlatformsInput

type GetProviderPlatformsInput struct {
	Sort              *db.TerraformProviderPlatformSortableField
	PaginationOptions *pagination.Options
	ProviderID        *string
	ProviderVersionID *string
	BinaryUploaded    *bool
	OperatingSystem   *string
	Architecture      *string
}

GetProviderPlatformsInput is the input for listing provider platforms

type GetProviderVersionsInput

type GetProviderVersionsInput struct {
	Sort                     *db.TerraformProviderVersionSortableField
	PaginationOptions        *pagination.Options
	SHASumsUploaded          *bool
	SHASumsSignatureUploaded *bool
	SemanticVersion          *string
	Latest                   *bool
	ProviderID               string
}

GetProviderVersionsInput is the input for getting a list of provider versions

type GetProvidersInput

type GetProvidersInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.TerraformProviderSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// Group filters providers be the specified group
	Group *models.Group
	// Search filters provider list by providers with a name that contains the search query
	Search *string
}

GetProvidersInput is the input for getting a list of terraform providers

type MockRegistryStore

type MockRegistryStore struct {
	mock.Mock
}

MockRegistryStore is an autogenerated mock type for the RegistryStore type

func NewMockRegistryStore

func NewMockRegistryStore(t mockConstructorTestingTNewMockRegistryStore) *MockRegistryStore

NewMockRegistryStore creates a new instance of MockRegistryStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockRegistryStore) GetProviderPlatformBinaryPresignedURL

func (_m *MockRegistryStore) GetProviderPlatformBinaryPresignedURL(ctx context.Context, providerPlatform *models.TerraformProviderPlatform, providerVersion *models.TerraformProviderVersion, provider *models.TerraformProvider) (string, error)

GetProviderPlatformBinaryPresignedURL provides a mock function with given fields: ctx, providerPlatform, providerVersion, provider

func (*MockRegistryStore) GetProviderVersionReadme

func (_m *MockRegistryStore) GetProviderVersionReadme(ctx context.Context, providerVersion *models.TerraformProviderVersion, provider *models.TerraformProvider) (io.ReadCloser, error)

GetProviderVersionReadme provides a mock function with given fields: ctx, providerVersion, provider

func (*MockRegistryStore) GetProviderVersionSHASumsPresignedURL

func (_m *MockRegistryStore) GetProviderVersionSHASumsPresignedURL(ctx context.Context, providerVersion *models.TerraformProviderVersion, provider *models.TerraformProvider) (string, error)

GetProviderVersionSHASumsPresignedURL provides a mock function with given fields: ctx, providerVersion, provider

func (*MockRegistryStore) GetProviderVersionSHASumsSignaturePresignedURL

func (_m *MockRegistryStore) GetProviderVersionSHASumsSignaturePresignedURL(ctx context.Context, providerVersion *models.TerraformProviderVersion, provider *models.TerraformProvider) (string, error)

GetProviderVersionSHASumsSignaturePresignedURL provides a mock function with given fields: ctx, providerVersion, provider

func (*MockRegistryStore) UploadProviderPlatformBinary

func (_m *MockRegistryStore) UploadProviderPlatformBinary(ctx context.Context, providerPlatform *models.TerraformProviderPlatform, providerVersion *models.TerraformProviderVersion, provider *models.TerraformProvider, body io.Reader) error

UploadProviderPlatformBinary provides a mock function with given fields: ctx, providerPlatform, providerVersion, provider, body

func (*MockRegistryStore) UploadProviderVersionReadme

func (_m *MockRegistryStore) UploadProviderVersionReadme(ctx context.Context, providerVersion *models.TerraformProviderVersion, provider *models.TerraformProvider, body io.Reader) error

UploadProviderVersionReadme provides a mock function with given fields: ctx, providerVersion, provider, body

func (*MockRegistryStore) UploadProviderVersionSHASums

func (_m *MockRegistryStore) UploadProviderVersionSHASums(ctx context.Context, providerVersion *models.TerraformProviderVersion, provider *models.TerraformProvider, body io.Reader) error

UploadProviderVersionSHASums provides a mock function with given fields: ctx, providerVersion, provider, body

func (*MockRegistryStore) UploadProviderVersionSHASumsSignature

func (_m *MockRegistryStore) UploadProviderVersionSHASumsSignature(ctx context.Context, providerVersion *models.TerraformProviderVersion, provider *models.TerraformProvider, body io.Reader) error

UploadProviderVersionSHASumsSignature provides a mock function with given fields: ctx, providerVersion, provider, body

type ProviderPlatformDownloadURLs

type ProviderPlatformDownloadURLs struct {
	DownloadURL         string
	SHASumsURL          string
	SHASumsSignatureURL string
}

ProviderPlatformDownloadURLs contains the signed URLs for downloading a particular provider platform

type RegistryStore

type RegistryStore interface {
	UploadProviderPlatformBinary(
		ctx context.Context,
		providerPlatform *models.TerraformProviderPlatform,
		providerVersion *models.TerraformProviderVersion,
		provider *models.TerraformProvider,
		body io.Reader,
	) error
	UploadProviderVersionReadme(
		ctx context.Context,
		providerVersion *models.TerraformProviderVersion,
		provider *models.TerraformProvider,
		body io.Reader,
	) error
	UploadProviderVersionSHASums(
		ctx context.Context,
		providerVersion *models.TerraformProviderVersion,
		provider *models.TerraformProvider,
		body io.Reader,
	) error
	UploadProviderVersionSHASumsSignature(
		ctx context.Context,
		providerVersion *models.TerraformProviderVersion,
		provider *models.TerraformProvider,
		body io.Reader,
	) error
	GetProviderVersionReadme(
		ctx context.Context,
		providerVersion *models.TerraformProviderVersion,
		provider *models.TerraformProvider,
	) (io.ReadCloser, error)
	GetProviderPlatformBinaryPresignedURL(
		ctx context.Context,
		providerPlatform *models.TerraformProviderPlatform,
		providerVersion *models.TerraformProviderVersion,
		provider *models.TerraformProvider,
	) (string, error)
	GetProviderVersionSHASumsPresignedURL(
		ctx context.Context,
		providerVersion *models.TerraformProviderVersion,
		provider *models.TerraformProvider,
	) (string, error)
	GetProviderVersionSHASumsSignaturePresignedURL(
		ctx context.Context,
		providerVersion *models.TerraformProviderVersion,
		provider *models.TerraformProvider,
	) (string, error)
}

RegistryStore interface encapsulates the logic for saving workspace registrys

func NewRegistryStore

func NewRegistryStore(objectStore objectstore.ObjectStore) RegistryStore

NewRegistryStore creates an instance of the RegistryStore interface

type Service

type Service interface {
	GetProviderByID(ctx context.Context, id string) (*models.TerraformProvider, error)
	GetProviderByPath(ctx context.Context, path string) (*models.TerraformProvider, error)
	GetProviderByAddress(ctx context.Context, namespace string, name string) (*models.TerraformProvider, error)
	GetProvidersByIDs(ctx context.Context, ids []string) ([]models.TerraformProvider, error)
	GetProviders(ctx context.Context, input *GetProvidersInput) (*db.ProvidersResult, error)
	CreateProvider(ctx context.Context, input *CreateProviderInput) (*models.TerraformProvider, error)
	UpdateProvider(ctx context.Context, provider *models.TerraformProvider) (*models.TerraformProvider, error)
	DeleteProvider(ctx context.Context, provider *models.TerraformProvider) error
	GetProviderVersionByID(ctx context.Context, id string) (*models.TerraformProviderVersion, error)
	GetProviderVersions(ctx context.Context, input *GetProviderVersionsInput) (*db.ProviderVersionsResult, error)
	GetProviderVersionsByIDs(ctx context.Context, ids []string) ([]models.TerraformProviderVersion, error)
	CreateProviderVersion(ctx context.Context, input *CreateProviderVersionInput) (*models.TerraformProviderVersion, error)
	DeleteProviderVersion(ctx context.Context, providerVersion *models.TerraformProviderVersion) error
	GetProviderVersionReadme(ctx context.Context, providerVersion *models.TerraformProviderVersion) (string, error)
	GetProviderPlatformByID(ctx context.Context, id string) (*models.TerraformProviderPlatform, error)
	GetProviderPlatforms(ctx context.Context, input *GetProviderPlatformsInput) (*db.ProviderPlatformsResult, error)
	CreateProviderPlatform(ctx context.Context, input *CreateProviderPlatformInput) (*models.TerraformProviderPlatform, error)
	DeleteProviderPlatform(ctx context.Context, providerPlatform *models.TerraformProviderPlatform) error
	UploadProviderPlatformBinary(ctx context.Context, providerPlatformID string, reader io.Reader) error
	UploadProviderVersionReadme(ctx context.Context, providerVersionID string, reader io.Reader) error
	UploadProviderVersionSHA256Sums(ctx context.Context, providerVersionID string, reader io.Reader) error
	UploadProviderVersionSHA256SumsSignature(ctx context.Context, providerVersionID string, reader io.Reader) error
	GetProviderPlatformDownloadURLs(ctx context.Context, providerPlatform *models.TerraformProviderPlatform) (*ProviderPlatformDownloadURLs, error)
}

Service implements all provider registry functionality

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
	limitChecker limits.LimitChecker,
	registryStore RegistryStore,
	activityService activityevent.Service,
) Service

NewService creates an instance of Service

Jump to

Keyboard shortcuts

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