resourceResolver

package
v0.0.0-...-0174093 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	DependencyId string
	ResourceId   string
}

type MongoStorage

type MongoStorage struct {
	Collection  *mongo.Collection
	PollTimeout time.Duration
}

func (*MongoStorage) Poll

func (storage *MongoStorage) Poll(ctx context.Context, limit int) ([]Binding, error)

func (*MongoStorage) Resolve

func (storage *MongoStorage) Resolve(ctx context.Context, dependencyIds ...string) error

func (*MongoStorage) Save

func (storage *MongoStorage) Save(ctx context.Context, dependencyId string, resourceId string) error

type Resolver

type Resolver struct {
	System       system.AbstractSystem
	Storage      Storage
	PollLimit    int
	PollInterval time.Duration
	Logger       *slog.Logger
}

func (*Resolver) Bind

func (resolver *Resolver) Bind(ctx context.Context, depId string, data any) error

func (*Resolver) Ready

func (resolver *Resolver) Ready(ctx context.Context) (<-chan string, error)

type Storage

type Storage interface {
	Save(ctx context.Context, dependencyId string, resourceId string) error
	Resolve(ctx context.Context, resourceIds ...string) error
	Poll(ctx context.Context, limit int) ([]Binding, error)
}

Jump to

Keyboard shortcuts

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