Documentation
¶
Overview ¶
Package privacy pkg/skychat/privacy/store.go c3-app-chat
Package privacy keeps who may message this visor: a block list, and, when approval is on, the people already let in. Local, never sent to a peer.
Index ¶
- Constants
- Variables
- type Store
- func (s *Store) Accept(pk string) error
- func (s *Store) Accepted(pk string) bool
- func (s *Store) Approval() bool
- func (s *Store) Blocked(pk string) bool
- func (s *Store) BlockedList() []string
- func (s *Store) SetApproval(on bool, existing []string) error
- func (s *Store) SetBlocked(pk string, blocked bool) error
- func (s *Store) Unaccept(pk string) error
- func (s *Store) Verdict(pk string, known bool) Verdict
- type Verdict
Constants ¶
const MaxEntries = 5000
MaxEntries bounds each list, since the file is rewritten whole on a change.
Variables ¶
var ErrFull = errors.New("skychat privacy: list is full")
ErrFull is returned when a list would grow past MaxEntries.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the on-disk privacy state. Safe for concurrent use.
func (*Store) Approval ¶
Approval reports whether new peers must be accepted before they are let in.
func (*Store) BlockedList ¶
BlockedList returns the blocked keys, sorted.
func (*Store) SetApproval ¶
SetApproval turns approval on or off. Turning it on accepts every key in existing, so conversations already under way do not become requests.
func (*Store) SetBlocked ¶
SetBlocked blocks or unblocks pk.