Documentation ¶
Index ¶
- Constants
- Variables
- func ListObjects(ctx context.Context) (objects []string)
- func ListSources(ctx context.Context) (sources []string)
- type Resolver
- func (r *Resolver[T]) HeatCacheAndWatch(ctx context.Context, watchOpts ...configx.WatchOption) error
- func (r *Resolver[T]) Lookup(ctx context.Context) (T, error)
- func (r *Resolver[T]) Resolve(ctx context.Context) (T, error)
- func (r *Resolver[T]) SetCleaner(cleaner func(context.Context, string, T) error)
- func (r *Resolver[T]) SetLoader(loader func(context.Context, string) (T, error))
- func (r *Resolver[T]) WatchConfig(ctx context.Context, opts ...configx.WatchOption)
- type SourcesProvider
Constants ¶
const ( DatasourceTplKey = "DataSource" ObjectServiceTplKey = "Object" )
Variables ¶
var ( DataSourceContextKey = dsContextKey{} ObjectServiceContextKey = objContextKey{} )
Functions ¶
func ListObjects ¶
ListObjects is a SourcesProvider returning *object.MinioConfig list
func ListSources ¶
ListSources is a SourcesProvider returning *object.Datasource list
Types ¶
type Resolver ¶
type Resolver[T any] struct { // contains filtered or unexported fields }
Resolver is a util for iterating/resolving datasource injected in context
func NewResolver ¶
func NewResolver[T any](ctxKey any, srvPrefix string, provider SourcesProvider) *Resolver[T]
NewResolver creates a new resolver with a SourcesProvider
func (*Resolver[T]) HeatCacheAndWatch ¶
func (r *Resolver[T]) HeatCacheAndWatch(ctx context.Context, watchOpts ...configx.WatchOption) error
HeatCacheAndWatch use internal loader and SourcesProvider to put all data in cache. WatchOptions are used to start a watch on config
func (*Resolver[T]) Lookup ¶
Lookup tries to load from cache and return an error if not found, without triggering loader
func (*Resolver[T]) SetCleaner ¶
SetCleaner registers a clean function to be called when a source is removed
func (*Resolver[T]) WatchConfig ¶
func (r *Resolver[T]) WatchConfig(ctx context.Context, opts ...configx.WatchOption)
WatchConfig watches sources and triggers loader/cleaner for new/removed sources
type SourcesProvider ¶
SourcesProvider generates a source of keys based on context
Directories ¶
Path | Synopsis |
---|---|
Package index provides indexation for datasources
|
Package index provides indexation for datasources |
sessions
Package sessions is used during indexation to start/stop a session an speed-up the process
|
Package sessions is used during indexation to start/stop a session an speed-up the process |
service
Package objects is in charge of exposing the content of the datasource with the S3 protocol.
|
Package objects is in charge of exposing the content of the datasource with the S3 protocol. |
Package sync provides service for synchronizing objects to indexes
|
Package sync provides service for synchronizing objects to indexes |
service
Package sync ties the "objects" and "index" together
|
Package sync ties the "objects" and "index" together |