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) Check(peerID peer.ID) (bool, bool)
- func (p *Policy) Config(cfg config.Policy) error
- func (p *Policy) ToConfig() config.Policy
- func (p *Policy) Trusted(peerID peer.ID) bool
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 ¶ added in v0.2.0
Allow alters the policy to allow the specified peer. Returns true if the policy needed to be updated.
func (*Policy) Allowed ¶
Allowed returns true if the policy allows the peer to index content. This check does not check whether the peer is trusted. An allowed peer must still be verified.
func (*Policy) Block ¶ added in v0.2.0
Block alters the policy to not allow the specified peer. Returns true if the policy needed to be updated.
func (*Policy) Check ¶ added in v0.2.0
Check returns whether the two bool values. The fisrt is true if the peer is allowed. The second is true if the peer is allowed and is trusted (does not require verification).
Click to show internal directories.
Click to hide internal directories.