Documentation ¶
Overview ¶
Package protobufadapter is a generated protocol buffer package.
It is generated from these files:
policy.proto
It has these top-level messages:
Policy
Index ¶
- type Adapter
- func (a *Adapter) AddPolicy(sec string, ptype string, rule []string) error
- func (a *Adapter) LoadPolicy(model model.Model) error
- func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *Adapter) RemovePolicy(sec string, ptype string, rule []string) error
- func (a *Adapter) SavePolicy(model model.Model) error
- type Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter represents the Protocol Buffers adapter for policy persistence. It can load policy from protobuf bytes or save policy to protobuf bytes.
func NewAdapter ¶
NewAdapter is the constructor for Adapter.
func (*Adapter) LoadPolicy ¶
LoadPolicy loads policy from protobuf bytes.
func (*Adapter) RemoveFilteredPolicy ¶
func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy removes policy rules that match the filter from the storage.
func (*Adapter) RemovePolicy ¶
RemovePolicy removes a policy rule from the storage.
type Policy ¶
type Policy struct {
Rules []string `protobuf:"bytes,1,rep,name=rules" json:"rules,omitempty"`
}
func (*Policy) Descriptor ¶
func (*Policy) ProtoMessage ¶
func (*Policy) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.