prefixcfg

package
v0.0.0-...-dd6fa2d Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package prefixcfg allows to configure prefix metadata via service configs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportConfig

func ImportConfig(ctx context.Context) error

ImportConfig is called from a cron to import prefixes.cfg into the datastore.

Types

type Config

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

Config holds parsed and transformed configs in memory, refetching them from the datastore occasionally.

func NewConfig

func NewConfig(ctx context.Context) (*Config, error)

NewConfig loads the initial copy of the config from the datastore.

func (*Config) Lookup

func (c *Config) Lookup(path string) *Entry

Lookup returns a config entry to use for the given prefix or package.

It is a fast local operation and it can't fail. If the prefix doesn't have a config, returns a default one.

func (*Config) RefreshPeriodically

func (c *Config) RefreshPeriodically(ctx context.Context)

RefreshPeriodically runs a loop that periodically refetches the config from the datastore to update the local in-memory cache.

type Entry

type Entry struct {
	PrefixConfig           *configpb.Prefix
	AllowWritersFromRegexp []*regexp.Regexp
}

Jump to

Keyboard shortcuts

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