cachesvc

package
v0.15.14 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProviderConfigReader

type ProviderConfigReader interface {
	ReadProviders(ctx context.Context) (deploy.ProviderMap, error)
}

type ResourceFetcher added in v0.15.0

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

ResourceFetcher fetches resources from provider lambda handler based on provider schema's "loadResources" object.

func NewResourceFetcher added in v0.15.0

func NewResourceFetcher(targetGroupID string, runtime *handlerclient.Client) *ResourceFetcher

func (*ResourceFetcher) LoadResources added in v0.15.0

func (rf *ResourceFetcher) LoadResources(ctx context.Context, tasks []string) ([]cache.TargateGroupResource, error)

LoadResources invokes the deployment

type Service

type Service struct {
	DB                   ddb.Storage
	AccessHandlerClient  ahtypes.ClientWithResponsesInterface
	ProviderConfigReader ProviderConfigReader
	RequestRouter        *requestroutersvc.Service
}

Service holds business logic relating to Access Requests.

func (*Service) LoadCachedProviderArgOptions

func (s *Service) LoadCachedProviderArgOptions(ctx context.Context, providerId string, argId string) (bool, []cache.ProviderOption, []cache.ProviderArgGroupOption, error)

loadCachedProviderArgOptions handles the case where we fetch arg options from the DynamoDB cache. If cached options aren't present it falls back to refetching options from the Access Handler. If options are refetched, the cache is updated.

func (*Service) RefreshCachedProviderArgOptions

func (s *Service) RefreshCachedProviderArgOptions(ctx context.Context, providerId string, argId string) (bool, []cache.ProviderOption, []cache.ProviderArgGroupOption, error)

refreshProviderArgOptions deletes any cached options and then refetches them from the Access Handler. It updates the cached options. To prevent an extended period of time where options are unavailable, we only update the items, and delete any that are no longer present (fixes SOL-35) return true if options were refetched, false if they were already cached

func (*Service) RefreshCachedTargetGroupResources added in v0.15.0

func (s *Service) RefreshCachedTargetGroupResources(ctx context.Context, tg target.Group) error

RefreshCachedTargetGroupResources deletes any cached options and then refetches them from the available deployment. It updates the cached options. To prevent an extended period of time where options are unavailable, we only update the items, and delete any that are no longer present (fixes SOL-35) return true if options were refetched, false if they were already cached

Jump to

Keyboard shortcuts

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