mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-09 09:06:36 +08:00
refactor(backend): rename OpenFlare directory to lowercase openflare
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// Copyright 2026 Arctel.net
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package publicconfig implements contracts.PublicConfigProvider for OpenFlare.
|
||||
package publicconfig
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"Wavelet/core"
|
||||
"Wavelet/openflare/plugins/server/kernel/repository"
|
||||
)
|
||||
|
||||
// Provider returns visibility=1 system configs as a flat key/value map,
|
||||
// matching gold GetPublicConfig.
|
||||
type Provider struct{}
|
||||
|
||||
// New constructs a PublicConfigProvider. ctx is accepted for future binding
|
||||
// but the payload is loaded from the shared system config store.
|
||||
func New(_ *core.Context) *Provider {
|
||||
return &Provider{}
|
||||
}
|
||||
|
||||
// PublicConfig returns visibility=1 keys as map[string]string.
|
||||
func (p *Provider) PublicConfig(ctx context.Context) (any, error) {
|
||||
configs, err := repository.ListVisibleSystemConfigs(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp := make(map[string]string, len(configs))
|
||||
for _, config := range configs {
|
||||
resp[config.Key] = config.Value
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
Reference in New Issue
Block a user