cache

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package cache provides a private OpenTofu/Terraform provider cache server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

func NewConfig

func NewConfig(opts ...Option) *Config

func (*Config) Addr

func (cfg *Config) Addr() string

func (*Config) WithOptions

func (cfg *Config) WithOptions(opts ...Option) *Config

type Option

type Option func(Config) Config

func WithHostname

func WithHostname(hostname string) Option

func WithLogger added in v0.67.5

func WithLogger(logger log.Logger) Option

func WithPort

func WithPort(port int) Option

func WithProviderHandlers added in v0.58.7

func WithProviderHandlers(handlers ...handlers.ProviderHandler) Option

func WithServices added in v0.58.7

func WithServices(services ...services.Service) Option

func WithToken

func WithToken(token string) Option

type Server

type Server struct {
	*router.Router
	*Config

	ProviderController *controllers.ProviderController
	// contains filtered or unexported fields
}

Server is a private Terraform cache for provider caching.

func NewServer

func NewServer(opts ...Option) *Server

NewServer returns a new Server instance.

func (*Server) DiscoveryURL added in v0.67.12

func (server *Server) DiscoveryURL(ctx context.Context, registryName string) (*handlers.RegistryURLs, error)

DiscoveryURL looks for the first handler that can handle the given `registryName`, which is determined by the include and exclude settings in the `.terraformrc` CLI config file. If the handler is found, tries to discover its API endpoints otherwise return the default registry URLs.

func (*Server) Listen

func (server *Server) Listen() (net.Listener, error)

Listen starts listening to the given configuration address. It also automatically chooses a free port if not explicitly specified.

func (*Server) Run

func (server *Server) Run(ctx context.Context, ln net.Listener) error

Run starts the webserver and workers.

Directories

Path Synopsis
Package controllers provides the implementation of the controller for the provider endpoints.
Package controllers provides the implementation of the controller for the provider endpoints.
Package handlers provides the interfaces and common implementations for handling provider requests.
Package handlers provides the interfaces and common implementations for handling provider requests.
Package helpers provides utility functions for working with HTTP requests and responses.
Package helpers provides utility functions for working with HTTP requests and responses.
Package middleware provides a set of middleware for the Terragrunt provider cache server.
Package middleware provides a set of middleware for the Terragrunt provider cache server.
Package models provides the data structures used to represent Terraform providers and their details.
Package models provides the data structures used to represent Terraform providers and their details.
Package router provides a simple wrapper around the echo framework to create a REST API.
Package router provides a simple wrapper around the echo framework to create a REST API.
Package services provides the interface for services that can be run in the background.
Package services provides the interface for services that can be run in the background.

Jump to

Keyboard shortcuts

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