package suika
import "marisa.chaotic.ninja/suika"
Package suika is a hard-fork of the 0.3 series of soju, an user-friendly IRC bouncer in Go.
# Copyright (C) 2020 The soju Contributors # Copyright (C) 2023-present Izuru Yakumo et al.
suika is covered by the AGPLv3 license:
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Variables
- func FullVersion() string
- func GetNick(user *User, net *Network) string
- func GetRealname(user *User, net *Network) string
- func GetUsername(user *User, net *Network) string
- type Channel
- type Config
- type Database
- func OpenDB(driver, source string) (Database, error)
- func OpenPostgresDB(source string) (Database, error)
- func OpenSqliteDB(source string) (Database, error)
- type DatabaseStats
- type DeliveryReceipt
- type Identd
- func NewIdentd() *Identd
- func (s *Identd) Delete(remoteAddr, localAddr string)
- func (s *Identd) Serve(ln net.Listener) error
- func (s *Identd) Store(remoteAddr, localAddr, ident string)
- type Logger
- type MessageFilter
- type MetricsCollectorDatabase
- type Network
- type PostgresDB
- func (db *PostgresDB) Close() error
- func (db *PostgresDB) DeleteChannel(ctx context.Context, id int64) error
- func (db *PostgresDB) DeleteNetwork(ctx context.Context, id int64) error
- func (db *PostgresDB) DeleteUser(ctx context.Context, id int64) error
- func (db *PostgresDB) GetReadReceipt(ctx context.Context, networkID int64, name string) (*ReadReceipt, error)
- func (db *PostgresDB) GetUser(ctx context.Context, username string) (*User, error)
- func (db *PostgresDB) ListChannels(ctx context.Context, networkID int64) ([]Channel, error)
- func (db *PostgresDB) ListDeliveryReceipts(ctx context.Context, networkID int64) ([]DeliveryReceipt, error)
- func (db *PostgresDB) ListNetworks(ctx context.Context, userID int64) ([]Network, error)
- func (db *PostgresDB) ListUsers(ctx context.Context) ([]User, error)
- func (db *PostgresDB) MetricsCollector() prometheus.Collector
- func (db *PostgresDB) Stats(ctx context.Context) (*DatabaseStats, error)
- func (db *PostgresDB) StoreChannel(ctx context.Context, networkID int64, ch *Channel) error
- func (db *PostgresDB) StoreClientDeliveryReceipts(ctx context.Context, networkID int64, client string, receipts []DeliveryReceipt) error
- func (db *PostgresDB) StoreNetwork(ctx context.Context, userID int64, network *Network) error
- func (db *PostgresDB) StoreReadReceipt(ctx context.Context, networkID int64, receipt *ReadReceipt) error
- func (db *PostgresDB) StoreUser(ctx context.Context, user *User) error
- type ReadReceipt
- type SASL
- type Server
- func NewServer(db Database) *Server
- func (s *Server) Config() *Config
- func (s *Server) Serve(ln net.Listener) error
- func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (s *Server) SetConfig(cfg *Config)
- func (s *Server) Shutdown()
- func (s *Server) Start() error
- func (s *Server) Stats() *ServerStats
- type ServerStats
- type SqliteDB
- func (db *SqliteDB) Close() error
- func (db *SqliteDB) DeleteChannel(ctx context.Context, id int64) error
- func (db *SqliteDB) DeleteNetwork(ctx context.Context, id int64) error
- func (db *SqliteDB) DeleteUser(ctx context.Context, id int64) error
- func (db *SqliteDB) GetReadReceipt(ctx context.Context, networkID int64, name string) (*ReadReceipt, error)
- func (db *SqliteDB) GetUser(ctx context.Context, username string) (*User, error)
- func (db *SqliteDB) ListChannels(ctx context.Context, networkID int64) ([]Channel, error)
- func (db *SqliteDB) ListDeliveryReceipts(ctx context.Context, networkID int64) ([]DeliveryReceipt, error)
- func (db *SqliteDB) ListNetworks(ctx context.Context, userID int64) ([]Network, error)
- func (db *SqliteDB) ListUsers(ctx context.Context) ([]User, error)
- func (db *SqliteDB) MetricsCollector() prometheus.Collector
- func (db *SqliteDB) Stats(ctx context.Context) (*DatabaseStats, error)
- func (db *SqliteDB) StoreChannel(ctx context.Context, networkID int64, ch *Channel) error
- func (db *SqliteDB) StoreClientDeliveryReceipts(ctx context.Context, networkID int64, client string, receipts []DeliveryReceipt) error
- func (db *SqliteDB) StoreNetwork(ctx context.Context, userID int64, network *Network) error
- func (db *SqliteDB) StoreReadReceipt(ctx context.Context, networkID int64, receipt *ReadReceipt) error
- func (db *SqliteDB) StoreUser(ctx context.Context, user *User) error
- type User
Variables ¶
var ( // Version is the tagged release version in the form <major>.<minor>.<patch> // following semantic versioning and is overwritten by the build system. Version = defaultVersion // Commit is the commit sha of the build (normally from Git) and is overwritten // by the build system. Commit = defaultCommit // Build is the date and time of the build as an RFC3339 formatted string // and is overwritten by the build system. Build = defaultBuild )
Functions ¶
func FullVersion ¶
func FullVersion() string
FullVersion display the full version and build
func GetNick ¶
func GetRealname ¶
func GetUsername ¶
Types ¶
type Channel ¶
type Channel struct { ID int64 Name string Key string Detached bool DetachedInternalMsgID string RelayDetached MessageFilter ReattachOn MessageFilter DetachAfter time.Duration DetachOn MessageFilter }
type Config ¶
type Config struct { Hostname string Title string LogPath string HTTPOrigins []string AcceptProxyIPs config.IPSet MaxUserNetworks int MultiUpstream bool MOTD string UpstreamUserIPs []*net.IPNet }
type Database ¶
type Database interface { Close() error Stats(ctx context.Context) (*DatabaseStats, error) ListUsers(ctx context.Context) ([]User, error) GetUser(ctx context.Context, username string) (*User, error) StoreUser(ctx context.Context, user *User) error DeleteUser(ctx context.Context, id int64) error ListNetworks(ctx context.Context, userID int64) ([]Network, error) StoreNetwork(ctx context.Context, userID int64, network *Network) error DeleteNetwork(ctx context.Context, id int64) error ListChannels(ctx context.Context, networkID int64) ([]Channel, error) StoreChannel(ctx context.Context, networKID int64, ch *Channel) error DeleteChannel(ctx context.Context, id int64) error ListDeliveryReceipts(ctx context.Context, networkID int64) ([]DeliveryReceipt, error) StoreClientDeliveryReceipts(ctx context.Context, networkID int64, client string, receipts []DeliveryReceipt) error GetReadReceipt(ctx context.Context, networkID int64, name string) (*ReadReceipt, error) StoreReadReceipt(ctx context.Context, networkID int64, receipt *ReadReceipt) error }
func OpenDB ¶
func OpenPostgresDB ¶
func OpenSqliteDB ¶
type DatabaseStats ¶
type DeliveryReceipt ¶
type DeliveryReceipt struct { ID int64 Target string // channel or nick Client string InternalMsgID string }
type Identd ¶
type Identd struct {
// contains filtered or unexported fields
}
Identd implements an ident server, as described in RFC 1413.
func NewIdentd ¶
func NewIdentd() *Identd
func (*Identd) Delete ¶
func (*Identd) Serve ¶
func (*Identd) Store ¶
type Logger ¶
type Logger interface { Printf(format string, v ...interface{}) Debugf(format string, v ...interface{}) }
func NewLogger ¶
type MessageFilter ¶
type MessageFilter int
const ( // TODO: use customizable user defaults for FilterDefault FilterDefault MessageFilter = iota FilterNone FilterHighlight FilterMessage )
type MetricsCollectorDatabase ¶
type MetricsCollectorDatabase interface { Database MetricsCollector() prometheus.Collector }
type Network ¶
type Network struct { ID int64 Name string Addr string Nick string Username string Realname string Pass string ConnectCommands []string SASL SASL Enabled bool }
func (*Network) GetName ¶
func (*Network) URL ¶
type PostgresDB ¶
type PostgresDB struct {
// contains filtered or unexported fields
}
func (*PostgresDB) Close ¶
func (db *PostgresDB) Close() error
func (*PostgresDB) DeleteChannel ¶
func (db *PostgresDB) DeleteChannel(ctx context.Context, id int64) error
func (*PostgresDB) DeleteNetwork ¶
func (db *PostgresDB) DeleteNetwork(ctx context.Context, id int64) error
func (*PostgresDB) DeleteUser ¶
func (db *PostgresDB) DeleteUser(ctx context.Context, id int64) error
func (*PostgresDB) GetReadReceipt ¶
func (db *PostgresDB) GetReadReceipt(ctx context.Context, networkID int64, name string) (*ReadReceipt, error)
func (*PostgresDB) GetUser ¶
func (*PostgresDB) ListChannels ¶
func (*PostgresDB) ListDeliveryReceipts ¶
func (db *PostgresDB) ListDeliveryReceipts(ctx context.Context, networkID int64) ([]DeliveryReceipt, error)
func (*PostgresDB) ListNetworks ¶
func (*PostgresDB) ListUsers ¶
func (db *PostgresDB) ListUsers(ctx context.Context) ([]User, error)
func (*PostgresDB) MetricsCollector ¶
func (db *PostgresDB) MetricsCollector() prometheus.Collector
func (*PostgresDB) Stats ¶
func (db *PostgresDB) Stats(ctx context.Context) (*DatabaseStats, error)
func (*PostgresDB) StoreChannel ¶
func (*PostgresDB) StoreClientDeliveryReceipts ¶
func (db *PostgresDB) StoreClientDeliveryReceipts(ctx context.Context, networkID int64, client string, receipts []DeliveryReceipt) error
func (*PostgresDB) StoreNetwork ¶
func (*PostgresDB) StoreReadReceipt ¶
func (db *PostgresDB) StoreReadReceipt(ctx context.Context, networkID int64, receipt *ReadReceipt) error
func (*PostgresDB) StoreUser ¶
func (db *PostgresDB) StoreUser(ctx context.Context, user *User) error
type ReadReceipt ¶
type SASL ¶
type SASL struct { Mechanism string Plain struct { Username string Password string } // TLS client certificate authentication. External struct { // X.509 certificate in DER form. CertBlob []byte // PKCS#8 private key in DER form. PrivKeyBlob []byte } }
type Server ¶
type Server struct { Logger Logger Identd *Identd // can be nil MetricsRegistry prometheus.Registerer // can be nil // contains filtered or unexported fields }
func NewServer ¶
func (*Server) Config ¶
func (*Server) Serve ¶
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*Server) SetConfig ¶
func (*Server) Shutdown ¶
func (s *Server) Shutdown()
func (*Server) Start ¶
func (*Server) Stats ¶
func (s *Server) Stats() *ServerStats
type ServerStats ¶
type SqliteDB ¶
type SqliteDB struct {
// contains filtered or unexported fields
}
func (*SqliteDB) Close ¶
func (*SqliteDB) DeleteChannel ¶
func (*SqliteDB) DeleteNetwork ¶
func (*SqliteDB) DeleteUser ¶
func (*SqliteDB) GetReadReceipt ¶
func (db *SqliteDB) GetReadReceipt(ctx context.Context, networkID int64, name string) (*ReadReceipt, error)
func (*SqliteDB) GetUser ¶
func (*SqliteDB) ListChannels ¶
func (*SqliteDB) ListDeliveryReceipts ¶
func (db *SqliteDB) ListDeliveryReceipts(ctx context.Context, networkID int64) ([]DeliveryReceipt, error)
func (*SqliteDB) ListNetworks ¶
func (*SqliteDB) ListUsers ¶
func (*SqliteDB) MetricsCollector ¶
func (db *SqliteDB) MetricsCollector() prometheus.Collector
func (*SqliteDB) Stats ¶
func (db *SqliteDB) Stats(ctx context.Context) (*DatabaseStats, error)
func (*SqliteDB) StoreChannel ¶
func (*SqliteDB) StoreClientDeliveryReceipts ¶
func (db *SqliteDB) StoreClientDeliveryReceipts(ctx context.Context, networkID int64, client string, receipts []DeliveryReceipt) error
func (*SqliteDB) StoreNetwork ¶
func (*SqliteDB) StoreReadReceipt ¶
func (db *SqliteDB) StoreReadReceipt(ctx context.Context, networkID int64, receipt *ReadReceipt) error
func (*SqliteDB) StoreUser ¶
type User ¶
Source Files ¶
bridge.go certfp.go conn.go db.go db_postgres.go db_sqlite.go doc.go downstream.go ident.go irc.go msgstore.go msgstore_fs.go msgstore_memory.go net_go116.go rate.go server.go service.go upstream.go user.go version.go
Directories ¶
Path | Synopsis |
---|---|
cmd | |
cmd/suika | |
cmd/suikadb | |
cmd/suika-znc-import | |
config |
- Version
- v0.4.4 (latest)
- Published
- Feb 28, 2024
- Platform
- linux/amd64
- Imports
- 55 packages
- Last checked
- 1 month ago –
Tools for package owners.