Documentation ¶
Index ¶
- type Policy
- func (p *Policy) Allow(peerID peer.ID) bool
- func (p *Policy) Allowed(peerID peer.ID) bool
- func (p *Policy) Block(peerID peer.ID) bool
- func (p *Policy) Copy(other *Policy)
- func (p *Policy) NoneAllowed() bool
- func (p *Policy) PublishAllowed(publisherID, providerID peer.ID) bool
- func (p *Policy) ToConfig() config.Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
func (*Policy) Allow ¶
Allow alters the policy to allow the specified peer. Returns true if the policy needed to be updated.
func (*Policy) Block ¶
Block alters the policy to not allow the specified peer. Returns true if the policy needed to be updated.
func (*Policy) NoneAllowed ¶
Return true if no peers are allowed.
func (*Policy) PublishAllowed ¶
PublishAllowed returns true if policy allows the publisher to publish advertisements for the identified provider. This assumes that both are already allowed by policy.
Click to show internal directories.
Click to hide internal directories.