Documentation
¶
Index ¶
- type Analyzer
- type DisplayableRule
- type RequestInfo
- type Rule
- type ViperConfigAnalyzer
- func (a *ViperConfigAnalyzer) AddRule(r Rule)
- func (a *ViperConfigAnalyzer) Errors() []string
- func (a *ViperConfigAnalyzer) KnownRoles() []string
- func (a *ViperConfigAnalyzer) MatchesRule(ri *RequestInfo) *Rule
- func (a *ViperConfigAnalyzer) Rules() []Rule
- func (a *ViperConfigAnalyzer) UpdateFromConfigFile() error
- func (a *ViperConfigAnalyzer) WriteConfig() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DisplayableRule ¶
type DisplayableRule struct {
Name string
Source string
Protocol string
Host string
Path string
Roles []string
Timeout string
IsPublic bool
AdminOnly bool
}
func RuleToDisplayableRule ¶
func RuleToDisplayableRule(r Rule) *DisplayableRule
type RequestInfo ¶
type RequestInfo struct {
Method string
Protocol string
Host string
RequestURI string
SourceIP net.IP
}
func (*RequestInfo) GetURL ¶
func (ri *RequestInfo) GetURL() string
func (*RequestInfo) Valid ¶
func (ri *RequestInfo) Valid() bool
type Rule ¶
type Rule struct {
Name string
SourceAddress *net.IPNet
ProtocolPattern *string
HostPattern *string
PathPattern *string
Timeout *time.Duration
Public bool
PermittedRoles []string
}
func (*Rule) Matches ¶
func (r *Rule) Matches(ri *RequestInfo) bool
type ViperConfigAnalyzer ¶
type ViperConfigAnalyzer struct {
// contains filtered or unexported fields
}
func NewFromConfig ¶
func NewFromConfig() (*ViperConfigAnalyzer, error)
func (*ViperConfigAnalyzer) AddRule ¶
func (a *ViperConfigAnalyzer) AddRule(r Rule)
func (*ViperConfigAnalyzer) Errors ¶
func (a *ViperConfigAnalyzer) Errors() []string
func (*ViperConfigAnalyzer) KnownRoles ¶
func (a *ViperConfigAnalyzer) KnownRoles() []string
func (*ViperConfigAnalyzer) MatchesRule ¶
func (a *ViperConfigAnalyzer) MatchesRule(ri *RequestInfo) *Rule
func (*ViperConfigAnalyzer) Rules ¶
func (a *ViperConfigAnalyzer) Rules() []Rule
func (*ViperConfigAnalyzer) UpdateFromConfigFile ¶
func (a *ViperConfigAnalyzer) UpdateFromConfigFile() error
func (*ViperConfigAnalyzer) WriteConfig ¶
func (a *ViperConfigAnalyzer) WriteConfig() error
Click to show internal directories.
Click to hide internal directories.