Documentation ¶
Index ¶
- type Policy
- func (p *Policy) Allow(peerIDs ...peer.ID) bool
- func (p *Policy) Allowed(peerID peer.ID) bool
- func (p *Policy) Block(peerIDs ...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, and the provider is allowed.
Click to show internal directories.
Click to hide internal directories.