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)
|
||||
}
|
||||
|
||||
// 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.
|
||||
type PolicyStore struct {
|
||||
mu sync.RWMutex
|
||||
|
|
|
|||
Reference in New Issue