golib

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: ISC Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTUnknown                 CmdType = 0x00
	CTHello                           = 0x01
	CTInitClient                      = 0x02
	CTInvite                          = 0x03
	CTDecodeInvite                    = 0x04
	CTAcceptInvite                    = 0x05
	CTPM                              = 0x06
	CTAddressBook                     = 0x07
	CTLocalID                         = 0x08
	CTAcceptServerCert                = 0x09
	CTRejectServerCert                = 0x0a
	CTNewGroupChat                    = 0x0b
	CTInviteToGroupChat               = 0x0c
	CTAcceptGCInvite                  = 0x0d
	CTGetGC                           = 0x0e
	CTGCMsg                           = 0x0f
	CTListGCs                         = 0x10
	CTShareFile                       = 0x11
	CTUnshareFile                     = 0x12
	CTListSharedFiles                 = 0x13
	CTListUserContent                 = 0x14
	CTGetUserContent                  = 0x15
	CTPayTip                          = 0x16
	CTSubscribeToPosts                = 0x17
	CTUnsubscribeToPosts              = 0x18
	CTGCRemoveUser                    = 0x19
	CTKXReset                         = 0x20
	CTListPosts                       = 0x21
	CTReadPost                        = 0x22
	CTReadPostUpdates                 = 0x23
	CTGetUserNick                     = 0x24
	CTCommentPost                     = 0x25
	CTGetLocalInfo                    = 0x26
	CTRequestMediateID                = 0x27
	CTKXSearchPostAuthor              = 0x28
	CTRelayPostToAll                  = 0x29
	CTCreatePost                      = 0x30
	CTGCGetBlockList                  = 0x31
	CTGCAddToBlockList                = 0x32
	CTGCRemoveFromBlockList           = 0x33
	CTGCPart                          = 0x34
	CTGCKill                          = 0x35
	CTBlockUser                       = 0x36
	CTIgnoreUser                      = 0x37
	CTUnignoreUser                    = 0x38
	CTIsIgnored                       = 0x39
	CTListSubscribers                 = 0x3a
	CTListSubscriptions               = 0x3b
	CTListDownloads                   = 0x3c
	CTLNGetInfo                       = 0x3d
	CTLNListChannels                  = 0x3e
	CTLNListPendingChannels           = 0x3f
	CTLNGenInvoice                    = 0x40
	CTLNPayInvoice                    = 0x41
	CTLNGetServerNode                 = 0x42
	CTLNQueryRoute                    = 0x43
	CTLNGetBalances                   = 0x44
	CTLNDecodeInvoice                 = 0x45
	CTLNListPeers                     = 0x46
	CTLNConnectToPeer                 = 0x47
	CTLNDisconnectFromPeer            = 0x48
	CTLNOpenChannel                   = 0x49
	CTLNCloseChannel                  = 0x4a
	CTLNTryConnect                    = 0x4b
	CTLNInitDcrlnd                    = 0x4c
	CTLNRunDcrlnd                     = 0x4d
	CTCaptureDcrlndLog                = 0x4e
	CTLNGetDepositAddr                = 0x4f
	CTLNRequestRecvCapacity           = 0x50
	CTLNConfirmPayReqRecvChan         = 0x51
	CTConfirmFileDownload             = 0x52
	CTFTSendFile                      = 0x53
	CTEstimatePostSize                = 0x54
	CTLNStopDcrlnd                    = 0x55
	CTStopClient                      = 0x56
	CTListPayStats                    = 0x57
	CTSummUserPayStats                = 0x58
	CTClearPayStats                   = 0x59
	CTListUserPosts                   = 0x5a
	CTGetUserPost                     = 0x5b
	CTLocalRename                     = 0x5c
	CTGoOnline                        = 0x5d
	CTRemainOffline                   = 0x5e
	CTLNGetNodeInfo                   = 0x5f
	CTCreateLockFile                  = 0x60
	CTCloseLockFile                   = 0x61
	CTSkipWalletCheck                 = 0x62
	CTLNRestoreMultiSCB               = 0x63
	CTLNSaveMultiSCB                  = 0x64

	NTInviteReceived         = 0x1001
	NTInviteAccepted         = 0x1002
	NTInviteErrored          = 0x1003
	NTPM                     = 0x1004
	NTLocalIDNeeded          = 0x1005
	NTConfServerCert         = 0x1006
	NTServerSessChanged      = 0x1007
	NTNOP                    = 0x1008
	NTInvitedToGC            = 0x1009
	NTUserAcceptedGCInvite   = 0x100a
	NTGCListUpdated          = 0x100b
	NTGCMessage              = 0x100c
	NTKXCompleted            = 0x100d
	NTTipReceived            = 0x100e
	NTPostReceived           = 0x100f
	NTFileDownloadConfirm    = 0x1010
	NTFileDownloadCompleted  = 0x1011
	NTFileDownloadProgress   = 0x1012
	NTPostStatusReceived     = 0x1013
	NTLogLine                = 0x1014
	NTLNInitialChainSyncUpdt = 0x1015
	NTLNConfPayReqRecvChan   = 0x1016
	NTConfFileDownload       = 0x1017
	NTLNDcrlndStopped        = 0x1018
	NTClientStopped          = 0x1019
	NTUserPostsList          = 0x101a
	NTUserContentList        = 0x101b
)
View Source
const (
	ConnStateOffline        = 0
	ConnStateCheckingWallet = 1
	ConnStateOnline         = 2
)

Variables

This section is empty.

Functions

func AsyncCall

func AsyncCall(typ CmdType, id, clientHandle uint32, payload []byte)

func CmdResultLoop

func CmdResultLoop(cb CmdResultLoopCB)

func GetURL

func GetURL(url string) (string, error)

func Hello

func Hello()

func NextTime

func NextTime() string

NextTime reads from timeChan (blocks).

func ReadLoop

func ReadLoop(cb ReadLoopCB)

func ReadStr

func ReadStr() string

func SetTag

func SetTag(newt string)

func WriteStr

func WriteStr(s string)

Types

type CmdResult

type CmdResult struct {
	ID      uint32
	Type    CmdType
	Err     error
	Payload []byte
}

func NextCmdResult

func NextCmdResult() *CmdResult

type CmdResultLoopCB

type CmdResultLoopCB interface {
	F(*CmdResult)
}

type CmdType

type CmdType uint32

type CommentPostArgs

type CommentPostArgs struct {
	From    clientintf.UserID  `json:"from"`
	PID     clientintf.PostID  `json:"pid"`
	Comment string             `json:"comment"`
	Parent  *clientintf.PostID `json:"parent,omitempty"`
}

type ConfirmFileDownload

type ConfirmFileDownload struct {
	UID      clientintf.UserID  `json:"uid"`
	FID      zkidentity.ShortID `json:"fid"`
	Metadata rpc.FileMetadata   `json:"metadata"`
}

type ConfirmFileDownloadReply

type ConfirmFileDownloadReply struct {
	FID   zkidentity.ShortID `json:"fid"`
	Reply bool               `json:"reply"`
}

type FileDownloadProgress

type FileDownloadProgress struct {
	UID             clientintf.UserID `json:"uid"`
	FID             clientdb.FileID   `json:"fid"`
	Metadata        rpc.FileMetadata  `json:"metadata"`
	NbMissingChunks int               `json:"nb_missing_chunks"`
}

type GCAddressBookEntry

type GCAddressBookEntry struct {
	ID      zkidentity.ShortID  `json:"id"`
	Name    string              `json:"name"`
	Members []clientintf.UserID `json:"members"`
}

type GCInvitation

type GCInvitation struct {
	Inviter RemoteUser `json:"inviter"`
	IID     uint64     `json:"iid"`
	Name    string     `json:"name"`
}

type GCMessage

type GCMessage struct {
	SenderUID clientdb.UserID `json:"sender_uid"`
	ID        string          `json:"sid"` // sid == source id == gc name
	Msg       string          `json:"msg"`
	TimeStamp int64           `json:"timestamp"`
}

type GCMessageToSend

type GCMessageToSend struct {
	GC  zkidentity.ShortID `json:"gc"`
	Msg string             `json:"msg"`
}

type GCRemoveUserArgs

type GCRemoveUserArgs struct {
	GC  zkidentity.ShortID `json:"gc"`
	UID clientintf.UserID  `json:"uid"`
}

type GetRemoteFileArgs

type GetRemoteFileArgs struct {
	UID clientintf.UserID  `json:"uid"`
	FID zkidentity.ShortID `json:"fid"`
}

type IDInit

type IDInit struct {
	Nick string `json:"nick"`
	Name string `json:"name"`
}

type InitClient

type InitClient struct {
	ServerAddr     string `json:"server_addr"`
	DBRoot         string `json:"dbroot"`
	DownloadsDir   string `json:"downloads_dir"`
	LNRPCHost      string `json:"ln_rpc_host"`
	LNTLSCertPath  string `json:"ln_tls_cert_path"`
	LNMacaroonPath string `json:"ln_macaroon_path"`
	LogFile        string `json:"log_file"`
	MsgsRoot       string `json:"msgs_root"`
	DebugLevel     string `json:"debug_level"`
	WantsLogNtfns  bool   `json:"wants_log_ntfns"`
}

type InviteToGC

type InviteToGC struct {
	GC  zkidentity.ShortID `json:"gc"`
	UID clientdb.UserID    `json:"uid"`
}

type LNBalances

type LNBalances struct {
	Channel *lnrpc.ChannelBalanceResponse `json:"channel"`
	Wallet  *lnrpc.WalletBalanceResponse  `json:"wallet"`
}

type LNChannelPoint

type LNChannelPoint struct {
	Txid        string `json:"txid"`
	OutputIndex int    `json:"output_index"`
}

type LNCloseChannelRequest

type LNCloseChannelRequest struct {
	ChannelPoint LNChannelPoint `json:"channel_point"`
	Force        bool           `json:"force"`
}

type LNInitDcrlnd

type LNInitDcrlnd struct {
	RootDir         string   `json:"root_dir"`
	Network         string   `json:"network"`
	Password        string   `json:"password"`
	ExistingSeed    []string `json:"existingseed"`
	MultiChanBackup []byte   `json:"multichanbackup"`
}

type LNNewWalletSeed

type LNNewWalletSeed struct {
	Seed    string `json:"seed"`
	RPCHost string `json:"rpc_host"`
}

type LNPayInvoiceRequest

type LNPayInvoiceRequest struct {
	PaymentRequest string `json:"payment_request"`
	Amount         int64  `json:"amount"`
}

type LNReqChannelArgs

type LNReqChannelArgs struct {
	Server       string `json:"server"`
	Key          string `json:"key"`
	ChanSize     uint64 `json:"chan_size"`
	Certificates string `json:"certificates"`
}

type LNReqChannelEstValue

type LNReqChannelEstValue struct {
	Amount       uint64                `json:"amount"`
	ServerPolicy lpclient.ServerPolicy `json:"server_policy"`
}

type LNTryExternalDcrlnd

type LNTryExternalDcrlnd struct {
	RPCHost      string `json:"rpc_host"`
	TLSCertPath  string `json:"tls_cert_path"`
	MacaroonPath string `json:"macaroon_path"`
}

type LocalInfo

type LocalInfo struct {
	ID   clientintf.UserID `json:"id"`
	Nick string            `json:"nick"`
}

type LocalRenameArgs

type LocalRenameArgs struct {
	ID      zkidentity.ShortID `json:"id"`
	NewName string             `json:"new_name"`
	IsGC    bool               `json:"is_gc"`
}

type MediateIDArgs

type MediateIDArgs struct {
	Mediator clientintf.UserID `json:"mediator"`
	Target   clientintf.UserID `json:"target"`
}

type PM

type PM struct {
	UID       clientintf.UserID `json:"sid"` // sid == source id
	Msg       string            `json:"msg"`
	Mine      bool              `json:"mine"`
	TimeStamp int64             `json:"timestamp"`
}

type PayTipArgs

type PayTipArgs struct {
	UID    clientintf.UserID `json:"uid"`
	Amount float64           `json:"amount"`
}

type PostActionArgs

type PostActionArgs struct {
	From clientintf.UserID `json:"from"`
	PID  clientintf.PostID `json:"pid"`
}

type PostReceived

type PostReceived struct {
	UID      clientintf.UserID `json:"uid"`
	PostMeta rpc.PostMetadata  `json:"post_meta"`
}

type PostStatusReceived

type PostStatusReceived struct {
	PostFrom   clientintf.UserID      `json:"post_from"`
	PID        clientintf.PostID      `json:"pid"`
	StatusFrom clientintf.UserID      `json:"status_from"`
	Status     rpc.PostMetadataStatus `json:"status"`
	Mine       bool                   `json:"mine"`
}

type ReadLoopCB

type ReadLoopCB interface {
	F(string)
}

type ReadPostArgs

type ReadPostArgs struct {
	From clientintf.UserID `json:"from"`
	PID  clientintf.PostID `json:"pid"`
}

type RemoteUser

type RemoteUser struct {
	UID  string `json:"uid"`
	Name string `json:"name"`
	Nick string `json:"nick"`
}

type SendFileArgs

type SendFileArgs struct {
	UID      clientintf.UserID `json:"uid"`
	Filepath string            `json:"filepath"`
}

type ServerCert

type ServerCert struct {
	InnerFingerprint string `json:"inner_fingerprint"`
	OuterFingerprint string `json:"outer_fingerprint"`
}

type ServerSessState

type ServerSessState struct {
	State          int     `json:"state"`
	CheckWalletErr *string `json:"check_wallet_err"`
}

type ShareFileArgs

type ShareFileArgs struct {
	Filename    string `json:"filename"`
	UID         string `json:"uid"`
	Cost        uint64 `json:"cost"`
	Description string `json:"description"`
}

type UnshareFileArgs

type UnshareFileArgs struct {
	FID zkidentity.ShortID `json:"fid"`
	UID *clientintf.UserID `json:"uid"`
}

type UserContentList

type UserContentList struct {
	UID   clientintf.UserID     `json:"uid"`
	Files []clientdb.RemoteFile `json:"files"`
}

type UserPostList

type UserPostList struct {
	UID   clientintf.UserID  `json:"uid"`
	Posts []rpc.PostListItem `json:"posts"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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