elevate: add ParsePolicy helper
This commit is contained in:
parent
bd40dc9637
commit
116c7fa671
|
|
@ -65,6 +65,11 @@ func (p *Policy) Marshal() ([]byte, error) {
|
||||||
return yaml.Marshal(p)
|
return yaml.Marshal(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ParsePolicy parses YAML data into a Policy.
|
||||||
|
func ParsePolicy(data []byte, p *Policy) error {
|
||||||
|
return yaml.Unmarshal(data, p)
|
||||||
|
}
|
||||||
|
|
||||||
// PolicyStore manages a disk-backed global policy and in-memory session policies.
|
// PolicyStore manages a disk-backed global policy and in-memory session policies.
|
||||||
type PolicyStore struct {
|
type PolicyStore struct {
|
||||||
mu sync.RWMutex
|
mu sync.RWMutex
|
||||||
|
|
|
||||||
Reference in New Issue