Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultDirectory() string
- func Initialize(root, dataRoot, configRoot string)
- type Channel
- type ChannelIndexManager
- type ChannelListIndex
- type ChannelListItem
- type ChannelStore
- func (c *ChannelStore) AddUser(user, server, channel string)
- func (c *ChannelStore) GetTopic(server, channel string) string
- func (c *ChannelStore) GetUsers(server, channel string) []string
- func (c *ChannelStore) RemoveUser(user, server, channel string)
- func (c *ChannelStore) RemoveUserAll(user, server string)
- func (c *ChannelStore) RenameUser(oldNick, newNick, server string)
- func (c *ChannelStore) SetMode(server, channel, user, add, remove string)
- func (c *ChannelStore) SetTopic(topic, server, channel string)
- func (c *ChannelStore) SetUsers(users []string, server, channel string)
- type ChannelStoreUser
- type ClientSettings
- func (d *ClientSettings) Marshal(buf []byte) ([]byte, error)
- func (v ClientSettings) MarshalEasyJSON(w *jwriter.Writer)
- func (v ClientSettings) MarshalJSON() ([]byte, error)
- func (d *ClientSettings) Size() (s uint64)
- func (d *ClientSettings) Unmarshal(buf []byte) (uint64, error)
- func (v *ClientSettings) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *ClientSettings) UnmarshalJSON(data []byte) error
- type MapChannelListIndex
- type Message
- type MessageSearchProvider
- type MessageStore
- type Server
- type SessionStore
- type Store
- type User
- func (u *User) AddChannel(channel *Channel) error
- func (u *User) AddServer(server *Server) error
- func (u *User) GetCertificate() *tls.Certificate
- func (u *User) GetChannels() ([]*Channel, error)
- func (u *User) GetClientSettings() *ClientSettings
- func (u *User) GetLastIP() []byte
- func (u *User) GetLastMessages(server, channel string, count int) ([]Message, bool, error)
- func (u *User) GetMessages(server, channel string, count int, fromID string) ([]Message, bool, error)
- func (u *User) GetServer(address string) (*Server, error)
- func (u *User) GetServers() ([]*Server, error)
- func (u *User) LogMessage(id, server, from, to, content string) error
- func (d *User) Marshal(buf []byte) ([]byte, error)
- func (u *User) Remove()
- func (u *User) RemoveChannel(server, channel string) error
- func (u *User) RemoveServer(address string) error
- func (u *User) SearchMessages(server, channel, q string) ([]Message, error)
- func (u *User) SetCertificate(certPEM, keyPEM []byte) error
- func (u *User) SetClientSettings(settings *ClientSettings) error
- func (u *User) SetLastIP(ip []byte) error
- func (u *User) SetMessageSearchProvider(search MessageSearchProvider)
- func (u *User) SetMessageStore(store MessageStore)
- func (u *User) SetNick(nick, address string) error
- func (u *User) SetServerName(name, address string) error
- func (d *User) Size() (s uint64)
- func (d *User) Unmarshal(buf []byte) (uint64, error)
- func (u *User) UnmarshalClientSettingsJSON(b []byte) error
Constants ¶
View Source
const ChannelListUpdateInterval = time.Hour * 24
View Source
const ChannelListUpdateTimeout = time.Minute * 5
Variables ¶
View Source
var ( ErrInvalidCert = errors.New("Invalid certificate") ErrCouldNotSaveCert = errors.New("Could not save certificate") )
View Source
var (
ErrNotFound = errors.New("no item found")
)
View Source
var Path directory
Functions ¶
func DefaultDirectory ¶
func DefaultDirectory() string
func Initialize ¶
func Initialize(root, dataRoot, configRoot string)
Types ¶
type ChannelIndexManager ¶ added in v0.6.1
type ChannelIndexManager struct {
// contains filtered or unexported fields
}
func NewChannelIndexManager ¶ added in v0.6.1
func NewChannelIndexManager() *ChannelIndexManager
func (*ChannelIndexManager) Get ¶ added in v0.6.1
func (m *ChannelIndexManager) Get(server string) (ChannelListIndex, bool)
func (*ChannelIndexManager) Set ¶ added in v0.6.1
func (m *ChannelIndexManager) Set(server string, index ChannelListIndex)
type ChannelListIndex ¶ added in v0.6.1
type ChannelListIndex interface { Add(item *ChannelListItem) Finish() Search(q string) []*ChannelListItem SearchN(q string, start, n int) []*ChannelListItem }
type ChannelListItem ¶ added in v0.6.1
type ChannelStore ¶
type ChannelStore struct {
// contains filtered or unexported fields
}
func NewChannelStore ¶
func NewChannelStore() *ChannelStore
func (*ChannelStore) AddUser ¶
func (c *ChannelStore) AddUser(user, server, channel string)
func (*ChannelStore) GetTopic ¶
func (c *ChannelStore) GetTopic(server, channel string) string
func (*ChannelStore) GetUsers ¶
func (c *ChannelStore) GetUsers(server, channel string) []string
func (*ChannelStore) RemoveUser ¶
func (c *ChannelStore) RemoveUser(user, server, channel string)
func (*ChannelStore) RemoveUserAll ¶
func (c *ChannelStore) RemoveUserAll(user, server string)
func (*ChannelStore) RenameUser ¶
func (c *ChannelStore) RenameUser(oldNick, newNick, server string)
func (*ChannelStore) SetMode ¶
func (c *ChannelStore) SetMode(server, channel, user, add, remove string)
func (*ChannelStore) SetTopic ¶
func (c *ChannelStore) SetTopic(topic, server, channel string)
func (*ChannelStore) SetUsers ¶
func (c *ChannelStore) SetUsers(users []string, server, channel string)
type ChannelStoreUser ¶
type ChannelStoreUser struct {
// contains filtered or unexported fields
}
func NewChannelStoreUser ¶
func NewChannelStoreUser(nick string) *ChannelStoreUser
func (*ChannelStoreUser) String ¶
func (c *ChannelStoreUser) String() string
type ClientSettings ¶
type ClientSettings struct {
ColoredNicks bool
}
func DefaultClientSettings ¶
func DefaultClientSettings() *ClientSettings
func (ClientSettings) MarshalEasyJSON ¶
func (v ClientSettings) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ClientSettings) MarshalJSON ¶
func (v ClientSettings) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ClientSettings) Size ¶
func (d *ClientSettings) Size() (s uint64)
func (*ClientSettings) UnmarshalEasyJSON ¶
func (v *ClientSettings) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ClientSettings) UnmarshalJSON ¶
func (v *ClientSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MapChannelListIndex ¶ added in v0.6.1
type MapChannelListIndex struct {
// contains filtered or unexported fields
}
func NewMapChannelListIndex ¶ added in v0.6.1
func NewMapChannelListIndex() *MapChannelListIndex
func (*MapChannelListIndex) Add ¶ added in v0.6.1
func (idx *MapChannelListIndex) Add(item *ChannelListItem)
func (*MapChannelListIndex) Finish ¶ added in v0.6.1
func (idx *MapChannelListIndex) Finish()
func (*MapChannelListIndex) Search ¶ added in v0.6.1
func (idx *MapChannelListIndex) Search(q string) []*ChannelListItem
func (*MapChannelListIndex) SearchN ¶ added in v0.6.1
func (idx *MapChannelListIndex) SearchN(q string, start, n int) []*ChannelListItem
type Message ¶
type MessageSearchProvider ¶
type MessageStore ¶
type Server ¶
type SessionStore ¶
type Store ¶
type Store interface { GetUsers() ([]*User, error) SaveUser(user *User) error DeleteUser(user *User) error GetServer(user *User, host string) (*Server, error) GetServers(user *User) ([]*Server, error) SaveServer(user *User, server *Server) error RemoveServer(user *User, host string) error GetChannels(user *User) ([]*Channel, error) AddChannel(user *User, channel *Channel) error RemoveChannel(user *User, server, channel string) error }
type User ¶
type User struct { ID uint64 IDBytes []byte Username string // contains filtered or unexported fields }
func (*User) AddChannel ¶
func (*User) GetCertificate ¶
func (u *User) GetCertificate() *tls.Certificate
func (*User) GetChannels ¶
func (*User) GetClientSettings ¶
func (u *User) GetClientSettings() *ClientSettings
func (*User) GetLastMessages ¶
func (*User) GetMessages ¶
func (*User) GetServers ¶
func (*User) LogMessage ¶
func (*User) RemoveChannel ¶
func (*User) RemoveServer ¶
func (*User) SearchMessages ¶
func (*User) SetCertificate ¶
func (*User) SetClientSettings ¶
func (u *User) SetClientSettings(settings *ClientSettings) error
func (*User) SetMessageSearchProvider ¶
func (u *User) SetMessageSearchProvider(search MessageSearchProvider)
func (*User) SetMessageStore ¶
func (u *User) SetMessageStore(store MessageStore)
func (*User) SetServerName ¶
func (*User) UnmarshalClientSettingsJSON ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.