Documentation
¶
Overview ¶
Package namespaces keeps the namespaces in the database and in a cache (NS-02).
Index ¶
- type Registry
- func (this *Registry) Delete(ctx context.Context, name string) error
- func (this *Registry) Get(name string) (model.Namespace, bool)
- func (this *Registry) List() []model.Namespace
- func (this *Registry) Put(ctx context.Context, ns model.Namespace) (result model.Namespace, created bool, err error)
- func (this *Registry) Reload(ctx context.Context) error
- func (this *Registry) Run(ctx context.Context, interval time.Duration)
- type Topics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, s *store.Store, seed []model.Namespace, topics Topics, logger *slog.Logger) (*Registry, error)
New stores the seed namespaces that do not exist yet and loads all namespaces.
func (*Registry) Delete ¶
Delete removes a namespace without resources together with its topics (NS-05).
func (*Registry) Put ¶
func (this *Registry) Put(ctx context.Context, ns model.Namespace) (result model.Namespace, created bool, err error)
Put creates or updates a namespace; its topics are written first, so that a namespace never exists without them. A level that becomes registered gets its resources registered (NS-05).