Documentation ¶
Overview ¶
Package services provides the interface for services that can be run in the background.
Index ¶
- type ProviderCache
- func (cache *ProviderCache) Address() string
- func (cache *ProviderCache) ArchivePath() string
- func (cache *ProviderCache) AuthenticatePackage(ctx context.Context) (*getproviders.PackageAuthenticationResult, error)
- func (cache *ProviderCache) DocumentSHA256Sums(ctx context.Context) ([]byte, error)
- func (cache *ProviderCache) PackageDir() string
- func (cache *ProviderCache) Signature(ctx context.Context) ([]byte, error)
- func (cache *ProviderCache) Version() string
- type ProviderCaches
- type ProviderService
- func (service *ProviderService) CacheProvider(ctx context.Context, requestID string, provider *models.Provider) *ProviderCache
- func (service *ProviderService) GetProviderCache(provider *models.Provider) *ProviderCache
- func (service *ProviderService) Logger() log.Logger
- func (service *ProviderService) Run(ctx context.Context) error
- func (service *ProviderService) WaitForCacheReady(requestID string) ([]getproviders.Provider, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderCache ¶
type ProviderCache struct { *ProviderService *models.Provider // contains filtered or unexported fields }
func (*ProviderCache) Address ¶
func (cache *ProviderCache) Address() string
func (*ProviderCache) ArchivePath ¶
func (cache *ProviderCache) ArchivePath() string
func (*ProviderCache) AuthenticatePackage ¶
func (cache *ProviderCache) AuthenticatePackage(ctx context.Context) (*getproviders.PackageAuthenticationResult, error)
func (*ProviderCache) DocumentSHA256Sums ¶
func (cache *ProviderCache) DocumentSHA256Sums(ctx context.Context) ([]byte, error)
func (*ProviderCache) PackageDir ¶
func (cache *ProviderCache) PackageDir() string
func (*ProviderCache) Signature ¶
func (cache *ProviderCache) Signature(ctx context.Context) ([]byte, error)
func (*ProviderCache) Version ¶
func (cache *ProviderCache) Version() string
type ProviderCaches ¶
type ProviderCaches []*ProviderCache
func (ProviderCaches) Find ¶
func (caches ProviderCaches) Find(target *models.Provider) *ProviderCache
func (ProviderCaches) FindByRequestID ¶
func (caches ProviderCaches) FindByRequestID(requestID string) ProviderCaches
type ProviderService ¶
type ProviderService struct {
// contains filtered or unexported fields
}
func NewProviderService ¶
func NewProviderService(cacheDir, userCacheDir string, credsSource *cliconfig.CredentialsSource, logger log.Logger) *ProviderService
func (*ProviderService) CacheProvider ¶
func (service *ProviderService) CacheProvider(ctx context.Context, requestID string, provider *models.Provider) *ProviderCache
CacheProvider starts caching the given provider using non-blocking approach.
func (*ProviderService) GetProviderCache ¶
func (service *ProviderService) GetProviderCache(provider *models.Provider) *ProviderCache
GetProviderCache returns the requested provider archive cache, if it exists.
func (*ProviderService) Logger ¶
func (service *ProviderService) Logger() log.Logger
func (*ProviderService) Run ¶
func (service *ProviderService) Run(ctx context.Context) error
Run is responsible to handle a new caching requestID and removing temporary files upon completion.
func (*ProviderService) WaitForCacheReady ¶
func (service *ProviderService) WaitForCacheReady(requestID string) ([]getproviders.Provider, error)
WaitForCacheReady returns cached providers that were requested by `terraform init` from the cache server, with an URL containing the given `requestID` value. The function returns the value only when all cache requests have been processed.
Click to show internal directories.
Click to hide internal directories.