Documentation
¶
Index ¶
- func MatchPath(templatePath, requestPath string) (map[string]string, bool)
- func MergeMap(values map[string]interface{}, target map[string]interface{})
- func MergeValues(values url.Values, target map[string]interface{})
- type Config
- type Connector
- type Connectors
- type Loader
- type Notify
- type Resources
- type Rule
- type Rules
- func (r *Rules) Add(rule *Rule) error
- func (r *Rules) Init(ctx context.Context, fs afs.Service) error
- func (r Rules) Len() int
- func (r Rules) Less(i, j int) bool
- func (r *Rules) Load(ctx context.Context, fs afs.Service, URL string) error
- func (r Rules) Match(Path string) (*Rule, url.Values)
- func (r Rules) Swap(i, j int)
- type Secret
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchPath ¶
MatchPath parses Paths to match and extract {<param>} defined in rule.Path from request.Path, it returns extracted parameters and flag if requestPath matched templatePath
func MergeValues ¶
MergeValues merge values
Types ¶
type Config ¶
type Config struct {
URL string
CacheRules bool `json:",omitempty"`
Rules Rules
Connectors Connectors
DataCacheURL string `json:",omitempty"`
}
Config represents a config
func NewConfigFromEnv ¶
NewConfigFromEnv creates config from env
func NewConfigFromURL ¶
NewConfigFromURL creates new config from URL
func (*Config) ReloadChanged ¶
ReloadChanged reload changes if needed
type Connector ¶
type Connector struct {
Name string
URL string
Dialect string
Secrets *Secret `json:",omitempty"`
Config *dsc.Config
}
Connector represents database connector
type Connectors ¶
Connectors represents connectors pool
func (*Connectors) Add ¶
func (c *Connectors) Add(connector *Connector) error
func (Connectors) Get ¶
func (c Connectors) Get(name string) (*Connector, error)
Get returns a connector for supplied name
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader represents URL changes notifier
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
Resources represents a resource
func (*Resources) GetMissing ¶
GetMissing returns missing in snapshot URLs
type Rule ¶
type Rule struct {
Info rule.Info
Path string `json:",omitempty"`
PathPrefix string `json:",omitempty"`
UseCache bool `json:",omitempty"`
data.Meta
}
Rule represents data rule
Source Files
¶
Click to show internal directories.
Click to hide internal directories.