...

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 LoginHandle
    func Login(nickname string) (*LoginHandle, error)
    func (lh *LoginHandle) GetLoggedUser() *entity.User
    func (lh *LoginHandle) GetUser(id *entity.ID) (*entity.User, error)
    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() string
    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) Logout()
    func (lh *LoginHandle) MakeModerator(id *entity.ID) error
    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, parent *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) 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 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) GetLoggedUser

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

func (*LoginHandle) GetUser

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

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() string

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) Logout

func (lh *LoginHandle) Logout()

func (*LoginHandle) MakeModerator

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

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, parent *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) 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 {
    HostPort        string
    AddressProvider string
    MaxInConnCount  uint32
    MaxOutConnCount uint32
}

Subdirectories

Name Synopsis
..
cmd
dscuss-cli Command line interface for Dscuss.
crypto
entity
errors
log log provides logging facilities for Dscuss.
owner Owner is the user which owns the current network node.
p2p
connection
peer
packet This file is part of Dscuss.
sqlite
storage
strings
subs
thread