Versions in this module Expand all Collapse all v0 v0.0.1 Mar 16, 2023 Changes in this version + var Error *log.Logger + var Info *log.Logger + var MaxConnections = 6 + var Trace *log.Logger + func FileLines(path string, fn func(string) bool) error + func InitLog() + func IsEcho(e string) bool + func IsEmptySubject(s string) bool + func IsMsgId(id string) bool + func IsPassword(u string) bool + func IsPrivate(e string) bool + func IsSubject(s string) bool + func IsUsername(u string) bool + func MakeSecret(msg string) string + func MsgId(msg string) string + func OpenLog(trace io.Writer, info io.Writer, error io.Writer) + type DB struct + Idx Index + IdxSync sync.RWMutex + LockDepth int32 + Name string + Path string + Sync sync.RWMutex + func OpenDB(path string) *DB + func (db *DB) Access(info *MsgInfo, user *User) bool + func (db *DB) Blacklist(m *Msg) error + func (db *DB) BundlePath() string + func (db *DB) CreateIndex() error + func (db *DB) Echoes(names []string, q Query) []*Echo + func (db *DB) Edit(m *Msg) error + func (db *DB) Exists(Id string) *MsgInfo + func (db *DB) Get(Id string) *Msg + func (db *DB) GetBundle(Id string) string + func (db *DB) GetBundleInfo(Id string) (string, *MsgInfo) + func (db *DB) GetFast(Id string) *Msg + func (db *DB) GetTopics(mi []*MsgInfo) map[string][]string + func (db *DB) IndexPath() string + func (db *DB) LoadIndex() error + func (db *DB) Lock() bool + func (db *DB) LockPath() string + func (db *DB) Lookup(Id string) *MsgInfo + func (db *DB) LookupFast(Id string, bl bool) *MsgInfo + func (db *DB) LookupIDS(Ids []string) []*MsgInfo + func (db *DB) Match(info *MsgInfo, r Query) bool + func (db *DB) SelectIDS(r Query) []string + func (db *DB) Store(m *Msg) error + func (db *DB) Unlock() + type EDB struct + Info map[string]string + List []string + Path string + func LoadEcholist(path string) *EDB + func (db *EDB) Allowed(name string) bool + type Echo struct + Count int + Last *MsgInfo + Msg *Msg + Name string + Topics int + type Index struct + FileSize int64 + Hash map[string]*MsgInfo + List []string + type Msg struct + Addr string + Date int64 + Echo string + From string + MsgId string + Subj string + Tags Tags + Text string + To string + func DecodeBundle(msg string) (*Msg, error) + func DecodeMsgline(msg string, enc bool) (*Msg, error) + func (m *Msg) Dump() string + func (m *Msg) Encode() string + func (m *Msg) String() string + func (m *Msg) Tag(n string) (string, bool) + type MsgInfo struct + Echo string + From string + Id string + Num int + Off int64 + Repto string + To string + Topic string + type Node struct + Features map[string]bool + Force bool + Host string + func Connect(addr string) (*Node, error) + func (n *Node) Fetch(db *DB, Echolist []string, limit int) error + func (n *Node) Fetcher(db *DB, Echo string, limit int, wait *sync.WaitGroup, cond *sync.Cond) + func (n *Node) IsFeature(f string) bool + func (n *Node) List() ([]string, error) + func (n *Node) Post(pauth string, msg string) error + func (n *Node) Send(pauth string, msg string) error + func (n *Node) Store(db *DB, ids []string) error + type Query struct + Blacklisted bool + Echo string + From string + Lim int + Match func(mi *MsgInfo, q Query) bool + Repto string + Start int + To string + User User + type Tags struct + Hash map[string]string + List []string + func MakeTags(str string) (Tags, error) + func NewTags(str string) Tags + func (t *Tags) Add(str string) error + func (t *Tags) Del(tag string) bool + func (t *Tags) Get(n string) (string, bool) + func (t Tags) String() string + type UDB struct + ById map[int32]string + FileSize int64 + List []string + Names map[string]User + Path string + Secrets map[string]string + Sync sync.RWMutex + func OpenUsers(path string) *UDB + func (db *UDB) Access(Secret string) bool + func (db *UDB) Add(Name string, Mail string, Passwd string) error + func (db *UDB) Auth(User string, Passwd string) bool + func (db *UDB) Edit(u *User) error + func (db *UDB) Id(Secret string) int32 + func (db *UDB) LoadUsers() error + func (db *UDB) Name(Secret string) string + func (db *UDB) Secret(User string) string + func (db *UDB) UserInfo(Secret string) *User + func (db *UDB) UserInfoId(id int32) *User + func (db *UDB) UserInfoName(name string) *User + type User struct + Id int32 + Mail string + Name string + Secret string + Tags Tags