resources

package
v1.40.6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalResourcesOptions

type LocalResourcesOptions struct {
	Gateway *gateway.LocalGatewayService
}

type LocalResourcesService

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

func NewLocalResourcesService

func NewLocalResourcesService(opts LocalResourcesOptions) *LocalResourcesService

func (*LocalResourcesService) ClearServiceResources

func (l *LocalResourcesService) ClearServiceResources(serviceName string)

ClearServiceResources - Clear all resources registered by a service, typically done when the service terminates or is restarted

func (*LocalResourcesService) SubscribeToState

func (s *LocalResourcesService) SubscribeToState(fn func(lrs LocalResourcesState))

type ResourceName

type ResourceName = string

type ResourceRegister

type ResourceRegister[R any] struct {
	RequestingServices []string
	Resource           *R
}

type ResourceRegistrar

type ResourceRegistrar[R any] struct {
	// contains filtered or unexported fields
}

func NewResourceRegistrar

func NewResourceRegistrar[R any]() *ResourceRegistrar[R]

func (*ResourceRegistrar[R]) ClearRequestingService

func (r *ResourceRegistrar[R]) ClearRequestingService(requestingService string)

ClearRequestingService - Remove a requesting service from all resources, if it was the only requestor for a resource, the resource is also removed

func (*ResourceRegistrar[R]) Get

func (r *ResourceRegistrar[R]) Get(resourceName string) *R

func (*ResourceRegistrar[R]) GetAll

func (r *ResourceRegistrar[R]) GetAll() map[ResourceName]*ResourceRegister[R]

func (*ResourceRegistrar[R]) GetRequestingServices

func (r *ResourceRegistrar[R]) GetRequestingServices(name string) []string

func (*ResourceRegistrar[R]) Register

func (r *ResourceRegistrar[R]) Register(name string, requestingService string, resource *R) error

type ServiceResourceRefresher

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

func NewServiceResourceRefresher

func NewServiceResourceRefresher(serviceName string, args NewServiceResourceRefresherArgs) (*ServiceResourceRefresher, error)

type UpdateArgs

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

Jump to

Keyboard shortcuts

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