...

Package dscuss

import "vminko.org/dscuss"
Overview
Index
Subdirectories

Overview ▾

Dscuss package implements root API exposed to the user.

Index ▾

Constants
func Dir() string
func FullVersion() string
func Init(initDir string) error
func IsLoggedIn() bool
func Register(nickname, info string, s subs.Subscriptions) error
func Uninit()
type ByNickname
    func (a ByNickname) Len() int
    func (a ByNickname) Less(i, j int) bool
    func (a ByNickname) Swap(i, j int)
type LoginHandle
    func Login(nickname string) (*LoginHandle, error)
    func (lh *LoginHandle) AddModerator(id *entity.ID) error
    func (lh *LoginHandle) GetLoggedUser() *entity.User
    func (lh *LoginHandle) GetMessage(id *entity.ID) (*entity.Message, error)
    func (lh *LoginHandle) GetRootMessage(m *entity.Message) (*entity.Message, error)
    func (lh *LoginHandle) GetUser(id *entity.ID) (*entity.User, error)
    func (lh *LoginHandle) IsValid() bool
    func (lh *LoginHandle) ListBoard(offset, limit int) ([]*entity.Message, error)
    func (lh *LoginHandle) ListModerators() []*entity.ID
    func (lh *LoginHandle) ListOperationsOnMessage(id *entity.ID) ([]*entity.Operation, error)
    func (lh *LoginHandle) ListOperationsOnUser(id *entity.ID) ([]*entity.Operation, error)
    func (lh *LoginHandle) ListPeers() []*peer.Info
    func (lh *LoginHandle) ListSubscriptions() subs.Subscriptions
    func (lh *LoginHandle) ListThread(id *entity.ID) (*thread.Node, error)
    func (lh *LoginHandle) ListTopic(topic subs.Topic, offset, limit int) ([]*entity.Message, error)
    func (lh *LoginHandle) ListUserHistory() []*entity.UserHistory
    func (lh *LoginHandle) Logout()
    func (lh *LoginHandle) NewOperation(typ entity.OperationType, reason entity.OperationReason, comment string, objectID *entity.ID) (*entity.Operation, error)
    func (lh *LoginHandle) NewReply(subj, text string, parentID *entity.ID) (*entity.Message, error)
    func (lh *LoginHandle) NewThread(subj, text string, topic subs.Topic) (*entity.Message, error)
    func (lh *LoginHandle) PostEntity(e entity.Entity) error
    func (lh *LoginHandle) Relogin() error
    func (lh *LoginHandle) RemoveModerator(id *entity.ID) error
    func (lh *LoginHandle) Subscribe(topic subs.Topic) error
    func (lh *LoginHandle) Unsubscribe(topic subs.Topic) error
type NetworkConfig

Package files

config.go dscuss.go

Constants

const (
    Name       string = "Dscuss"
    Version    string = "0.1.0"
    DefaultDir string = "~/.dscuss"

    AddressListFileName string = "addresses.txt"
)

func Dir

func Dir() string

func FullVersion

func FullVersion() string

func Init

func Init(initDir string) error

func IsLoggedIn

func IsLoggedIn() bool

func Register

func Register(nickname, info string, s subs.Subscriptions) error

func Uninit

func Uninit()

type ByNickname

ByNickname implements sort.Interface for []*peer.Info based on the Nickname field.

type ByNickname []*peer.Info

func (ByNickname) Len

func (a ByNickname) Len() int

func (ByNickname) Less

func (a ByNickname) Less(i, j int) bool

func (ByNickname) Swap

func (a ByNickname) Swap(i, j int)

type LoginHandle

LoginHandle implements API exposed to a logged user.

type LoginHandle struct {
    // contains filtered or unexported fields
}

func Login

func Login(nickname string) (*LoginHandle, error)

func (*LoginHandle) AddModerator

func (lh *LoginHandle) AddModerator(id *entity.ID) error

func (*LoginHandle) GetLoggedUser

func (lh *LoginHandle) GetLoggedUser() *entity.User

func (*LoginHandle) GetMessage

func (lh *LoginHandle) GetMessage(id *entity.ID) (*entity.Message, error)

func (*LoginHandle) GetRootMessage

func (lh *LoginHandle) GetRootMessage(m *entity.Message) (*entity.Message, error)

func (*LoginHandle) GetUser

func (lh *LoginHandle) GetUser(id *entity.ID) (*entity.User, error)

func (*LoginHandle) IsValid

func (lh *LoginHandle) IsValid() bool

func (*LoginHandle) ListBoard

func (lh *LoginHandle) ListBoard(offset, limit int) ([]*entity.Message, error)

func (*LoginHandle) ListModerators

func (lh *LoginHandle) ListModerators() []*entity.ID

func (*LoginHandle) ListOperationsOnMessage

func (lh *LoginHandle) ListOperationsOnMessage(id *entity.ID) ([]*entity.Operation, error)

func (*LoginHandle) ListOperationsOnUser

func (lh *LoginHandle) ListOperationsOnUser(id *entity.ID) ([]*entity.Operation, error)

func (*LoginHandle) ListPeers

func (lh *LoginHandle) ListPeers() []*peer.Info

func (*LoginHandle) ListSubscriptions

func (lh *LoginHandle) ListSubscriptions() subs.Subscriptions

func (*LoginHandle) ListThread

func (lh *LoginHandle) ListThread(id *entity.ID) (*thread.Node, error)

TBD: add offset and limit

func (*LoginHandle) ListTopic

func (lh *LoginHandle) ListTopic(topic subs.Topic, offset, limit int) ([]*entity.Message, error)

func (*LoginHandle) ListUserHistory

func (lh *LoginHandle) ListUserHistory() []*entity.UserHistory

func (*LoginHandle) Logout

func (lh *LoginHandle) Logout()

func (*LoginHandle) NewOperation

func (lh *LoginHandle) NewOperation(
    typ entity.OperationType,
    reason entity.OperationReason,
    comment string,
    objectID *entity.ID,
) (*entity.Operation, error)

func (*LoginHandle) NewReply

func (lh *LoginHandle) NewReply(subj, text string, parentID *entity.ID) (*entity.Message, error)

func (*LoginHandle) NewThread

func (lh *LoginHandle) NewThread(subj, text string, topic subs.Topic) (*entity.Message, error)

func (*LoginHandle) PostEntity

func (lh *LoginHandle) PostEntity(e entity.Entity) error

func (*LoginHandle) Relogin

func (lh *LoginHandle) Relogin() error

func (*LoginHandle) RemoveModerator

func (lh *LoginHandle) RemoveModerator(id *entity.ID) error

func (*LoginHandle) Subscribe

func (lh *LoginHandle) Subscribe(topic subs.Topic) error

func (*LoginHandle) Unsubscribe

func (lh *LoginHandle) Unsubscribe(topic subs.Topic) error

type NetworkConfig

type NetworkConfig struct {
    Address         string
    Port            int
    AddressProvider string
    DHTAddress      string
    DHTPort         int
    DHTBootstrap    string
    MaxInConnCount  uint32
    MaxOutConnCount uint32
}

Subdirectories

Name Synopsis
..
address
cmd
dscuss-cli Command line interface for Dscuss.
dscuss-web Web interface for Dscuss.
config
controller controller responds to the user input and performs interactions on the Dscuss data model objects (Users, Messages, Operations, Threads, Subscriptions etc.) via Dscuss API.
static
view View presents the controller responds in HTML format.
crypto
entity
errors
io
log log provides logging facilities for Dscuss.
owner Owner is the user which owns the current network node.
p2p
connection
peer
packet
sqlite
storage
strings
subs
thread