slib

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2021 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlankForm tGlobalBlankForm
View Source
var Service tGlobalService
View Source
var Upload tGlobalUpload

Functions

func CheckPinNode added in v0.7.0

func CheckPinNode(iPin string) bool

func ErrorService added in v0.7.0

func ErrorService(iErr error) []string

func GetCcThread

func GetCcThread(iSvc string, iState *ClientState) interface{}

func GetCfService added in v0.6.0

func GetCfService(iSvc string) interface{}

func GetCnNode added in v0.8.0

func GetCnNode(iSvc string) interface{}

func GetConfigService

func GetConfigService(iSvc string) *tSvcConfig

func GetConstants

func GetConstants(iMap map[string]interface{}) map[string]interface{}

func GetDraftAdrsbk

func GetDraftAdrsbk(iSvc string) interface{}

func GetFromOhi

func GetFromOhi(iSvc string) []tOhiEl

func GetGroupAdrsbk

func GetGroupAdrsbk(iSvc string) []tGroupEl

func GetIdTag added in v0.7.0

func GetIdTag(iName string) string

func GetIdxAttach

func GetIdxAttach(iSvc string, iState *ClientState) interface{}

func GetIdxFilledForm added in v0.8.0

func GetIdxFilledForm(iSvc string) interface{}

func GetIdxNotice

func GetIdxNotice(iSvc string) []tNoticeEl

func GetIdxTag added in v0.7.0

func GetIdxTag() interface{}

func GetIdxThread

func GetIdxThread(iSvc string, iState *ClientState) interface{}

func GetPathAttach

func GetPathAttach(iSvc string, iState *ClientState, iMsgId string, iFile string) string

func GetPinNode added in v0.7.0

func GetPinNode(iAddr string) tNodeAddr

func GetReceivedAdrsbk

func GetReceivedAdrsbk(iSvc string) interface{}

func GetSentAdrsbk

func GetSentAdrsbk(iSvc string) interface{}

func GetToOhi

func GetToOhi(iSvc string) []tOhiEl

func HandleSyncService added in v0.7.0

func HandleSyncService(iSvc string, iHead *Header, iR io.Reader,
	iNotify func(func(*ClientState) []string, []string))

func HandleTmtpService

func HandleTmtpService(iSvc string, iHead *Header, iR io.Reader) (
	aFn func(*ClientState) []string, aToAll []string)

func HandleUpdtService

func HandleUpdtService(iSvc string, iState *ClientState, iUpdt *Update) (
	aFn func(*ClientState) []string, aToAll []string)

func Init

func Init(iStart func(string), iMts func(string, *Header), iCrash func(string, string))

func IsReservedFile added in v0.8.0

func IsReservedFile(i string) bool

func ListenNode added in v0.7.0

func ListenNode() []string

func LogoutService

func LogoutService(iSvc string) []string

func LookupAdrsbk

func LookupAdrsbk(iSvc string, iAlias string) string

func MakeNode added in v0.7.0

func MakeNode(iR io.Reader) error

func NewCountUtf8 added in v0.8.0

func NewCountUtf8(iR io.Reader, iExpect int64) *tCountUtf8

func SendAllOhi

func SendAllOhi(iW io.Writer, iSvc string, iId string) error

func SendService

func SendService(iW io.Writer, iSvc string, iSrec *SendRecord) error

func SetSyncPeriodNode added in v0.7.0

func SetSyncPeriodNode(iPeriod time.Duration)

func StartNode added in v0.7.0

func StartNode(iSvc string) []string

func WipeDataService added in v0.4.0

func WipeDataService(iSvc string) error

only for testing

func WriteMessagesThread

func WriteMessagesThread(iW io.Writer, iSvc string, iState *ClientState, iId string) error

func WriteResultSearch

func WriteResultSearch(iW io.Writer, iSvc string, iState *ClientState) error

Types

type ClientState

type ClientState struct {
	sync.RWMutex

	Hpos                 int                      // indexes History
	History              []string                 // thread id
	Thread               map[string]*tThreadState // key thread id
	SvcTabs              tTabs
	UploadSort, FormSort string `json:",omitempty"`
	// contains filtered or unexported fields
}

func OpenState

func OpenState(iClientId, iSvc string) *ClientState

func (*ClientState) GetSummary

func (o *ClientState) GetSummary() interface{}

type GlobalSet

type GlobalSet interface {
	Add(string, string, io.Reader) error
	Drop(string) error
	GetIdx() interface{}
	GetPath(string) string
}
type Header struct {
	Op                string
	Error             string
	Id, MsgId, PostId string
	Uid, NodeId       string
	NewNode, Node     string
	Info              string
	Ohi               []string
	From              string
	Posted            string
	To                string
	Gid               string
	NewAlias, Alias   string
	Act               string
	Status            int8
	Notify            uint16
	For               tForOhi
	Type              string
	DataLen, DataHead int64
	SubHead           *tHeader2
}

func (*Header) Check

func (o *Header) Check() bool

func (*Header) CheckSub

func (o *Header) CheckSub() bool

type Msg

type Msg map[string]interface{}

type SendRecord

type SendRecord struct {
	Id string // Id[0] is one of eSrec*
}

func GetQueue

func GetQueue(iSvc string, iPostFn func(...*SendRecord)) []*SendRecord

type Update

type Update struct {
	LogThreadId string `json:",omitempty"`
	LogOp       string `json:",omitempty"`
	Op          string
	Config      *struct {
		HistoryLen  int
		Addr        string
		Alias       string
		LoginPeriod int
	} `json:",omitempty"`
	Thread *struct {
		Id       string
		Alias    string
		Cc       []tCcEl
		Subject  string
		Data     string
		Attach   []tHeader2Attach
		FormFill map[string]string
		New      int8
	} `json:",omitempty"`
	Touch   *UpdateTouch `json:",omitempty"`
	Forward *struct {
		ThreadId string
		Cc       []tCcEl
		Qid      string
	} `json:",omitempty"`
	Ping *struct {
		Alias string
		To    string
		Text  string
		Gid   string
		Qid   string
	} `json:",omitempty"`
	Accept *struct {
		Qid string
	} `json:",omitempty"`
	Adrsbk *struct {
		Type int8
		Term string
	} `json:",omitempty"`
	Ohi *struct {
		Alias string
		Uid   string
	} `json:",omitempty"`
	Notice *struct {
		MsgId string
	} `json:",omitempty"`
	Tag *struct {
		Name string
		Id   string `json:",omitempty"`
	} `json:",omitempty"`
	Navigate *struct {
		History         int
		Label           string
		ThreadId, MsgId string
	} `json:",omitempty"`
	Tab *struct {
		Type   int8
		Term   string
		PosFor int8
		Pos    int
	} `json:",omitempty"`
	Sort *struct {
		Type  string
		Field string
	} `json:",omitempty"`
	Node *struct {
		Addr    string
		Pin     string
		Newnode string
	} `json:",omitempty"`
	Test *UpdateTest `json:",omitempty"`
	// contains filtered or unexported fields
}

type UpdateTest

type UpdateTest struct {
	Request []string
	Notice  []tNoticeEl
}

type UpdateTouch added in v0.8.0

type UpdateTouch struct {
	ThreadId, MsgId string
	TagId           string
	TagName         string `json:",omitempty"`
	Act             int8
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL