dimp

package
v0.0.0-...-cf97818 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * ==============================================================================

Index

Constants

View Source
const (
	EXPIRES_KEY      = "expires"
	DOCUMENT_EXPIRES = 30 * 60
)

Variables

This section is empty.

Functions

func RegisterCommonFactories

func RegisterCommonFactories()

*

  • Register common parsers

func UpgradeIDFactory

func UpgradeIDFactory()

Types

type AddressNameDataSource

type AddressNameDataSource struct {
	AddressNameServer
	// contains filtered or unexported fields
}

*

  • Data Source for ANS
  • ~~~~~~~~~~~~~~~~~~~

func (*AddressNameDataSource) GetID

func (ans *AddressNameDataSource) GetID(alias string) ID

func (*AddressNameDataSource) Init

func (*AddressNameDataSource) Save

func (ans *AddressNameDataSource) Save(alias string, identifier ID) bool

type CommonFacebook

type CommonFacebook struct {
	Facebook
	IFacebookExtension
	// contains filtered or unexported fields
}

*

  • Common Facebook
  • ~~~~~~~~~~~~~~~
  • Barrack for Server/Client

func (*CommonFacebook) AddContact

func (facebook *CommonFacebook) AddContact(contact ID, user ID) bool

func (*CommonFacebook) AddMember

func (facebook *CommonFacebook) AddMember(member ID, group ID) bool

func (*CommonFacebook) AddUser

func (facebook *CommonFacebook) AddUser(user User) bool

func (*CommonFacebook) ContainAssistant

func (facebook *CommonFacebook) ContainAssistant(bot ID, group ID) bool

func (*CommonFacebook) ContainMember

func (facebook *CommonFacebook) ContainMember(member ID, group ID) bool

func (*CommonFacebook) CreateGroup

func (facebook *CommonFacebook) CreateGroup(identifier ID) Group

func (*CommonFacebook) CreateUser

func (facebook *CommonFacebook) CreateUser(identifier ID) User

func (*CommonFacebook) DB

func (facebook *CommonFacebook) DB() IFacebookDatabase

func (*CommonFacebook) GetAssistants

func (facebook *CommonFacebook) GetAssistants(group ID) []ID

func (*CommonFacebook) GetContacts

func (facebook *CommonFacebook) GetContacts(user ID) []ID

func (*CommonFacebook) GetDocument

func (facebook *CommonFacebook) GetDocument(identifier ID, docType string) Document

func (*CommonFacebook) GetFounder

func (facebook *CommonFacebook) GetFounder(group ID) ID

func (*CommonFacebook) GetLocalUsers

func (facebook *CommonFacebook) GetLocalUsers() []User

func (*CommonFacebook) GetMembers

func (facebook *CommonFacebook) GetMembers(group ID) []ID

func (*CommonFacebook) GetMeta

func (facebook *CommonFacebook) GetMeta(identifier ID) Meta

func (*CommonFacebook) GetName

func (facebook *CommonFacebook) GetName(entity ID) string

func (*CommonFacebook) GetOwner

func (facebook *CommonFacebook) GetOwner(group ID) ID

func (*CommonFacebook) GetPrivateKeyForSignature

func (facebook *CommonFacebook) GetPrivateKeyForSignature(user ID) SignKey

func (*CommonFacebook) GetPrivateKeyForVisaSignature

func (facebook *CommonFacebook) GetPrivateKeyForVisaSignature(user ID) SignKey

func (*CommonFacebook) GetPrivateKeysForDecryption

func (facebook *CommonFacebook) GetPrivateKeysForDecryption(user ID) []DecryptKey

func (*CommonFacebook) Init

func (facebook *CommonFacebook) Init() *CommonFacebook

func (*CommonFacebook) IsExpiredDocument

func (facebook *CommonFacebook) IsExpiredDocument(doc Document, reset bool) bool

func (*CommonFacebook) RemoveContact

func (facebook *CommonFacebook) RemoveContact(contact ID, user ID) bool

func (*CommonFacebook) RemoveGroup

func (facebook *CommonFacebook) RemoveGroup(group ID) bool

func (*CommonFacebook) RemoveMember

func (facebook *CommonFacebook) RemoveMember(member ID, group ID) bool

func (*CommonFacebook) RemoveUser

func (facebook *CommonFacebook) RemoveUser(user User) bool

func (*CommonFacebook) SaveDocument

func (facebook *CommonFacebook) SaveDocument(doc Document) bool

func (*CommonFacebook) SaveMembers

func (facebook *CommonFacebook) SaveMembers(members []ID, group ID) bool

func (*CommonFacebook) SaveMeta

func (facebook *CommonFacebook) SaveMeta(meta Meta, identifier ID) bool

func (*CommonFacebook) SavePrivateKey

func (facebook *CommonFacebook) SavePrivateKey(key PrivateKey, keyType string, user ID) bool

func (*CommonFacebook) SetCurrentUser

func (facebook *CommonFacebook) SetCurrentUser(user User)

func (*CommonFacebook) SetDB

func (facebook *CommonFacebook) SetDB(db IFacebookDatabase)

type CommonIDFactory

type CommonIDFactory struct {
	IDFactory
	// contains filtered or unexported fields
}

*

  • ID Factory
  • ~~~~~~~~~~

func (*CommonIDFactory) CreateID

func (factory *CommonIDFactory) CreateID(name string, address Address, terminal string) ID

func (*CommonIDFactory) GenerateID

func (factory *CommonIDFactory) GenerateID(meta Meta, network NetworkType, terminal string) ID

func (*CommonIDFactory) Init

func (factory *CommonIDFactory) Init(ans AddressNameService, origin IDFactory) *CommonIDFactory

func (*CommonIDFactory) ParseID

func (factory *CommonIDFactory) ParseID(identifier string) ID

type CommonMessenger

type CommonMessenger struct {
	Messenger
	IMessengerExtension
}

*

  • Common Messenger
  • ~~~~~~~~~~~~~~~~

func (*CommonMessenger) Init

func (messenger *CommonMessenger) Init() *CommonMessenger

func (*CommonMessenger) QueryDocument

func (messenger *CommonMessenger) QueryDocument(identifier ID, docType string) bool

func (*CommonMessenger) QueryGroupInfo

func (messenger *CommonMessenger) QueryGroupInfo(group ID, members []ID) bool

func (*CommonMessenger) QueryMeta

func (messenger *CommonMessenger) QueryMeta(identifier ID) bool

func (*CommonMessenger) SerializeKey

func (messenger *CommonMessenger) SerializeKey(password SymmetricKey, iMsg InstantMessage) []byte

type CommonPacker

type CommonPacker struct {
	MessagePacker
}

*

  • Common Packer
  • ~~~~~~~~~~~~~

func (*CommonPacker) CipherKeyDelegate

func (packer *CommonPacker) CipherKeyDelegate() CipherKeyDelegate

func (*CommonPacker) EncryptMessage

func (packer *CommonPacker) EncryptMessage(iMsg InstantMessage) SecureMessage

func (*CommonPacker) Init

func (packer *CommonPacker) Init(facebook IFacebook, messenger IMessenger) *CommonPacker

type CommonProcessor

type CommonProcessor struct {
	MessageProcessor
}

*

  • Common Processor
  • ~~~~~~~~~~~~~~~~

func (*CommonProcessor) CommonFacebook

func (processor *CommonProcessor) CommonFacebook() ICommonFacebook

func (*CommonProcessor) CommonMessenger

func (processor *CommonProcessor) CommonMessenger() ICommonMessenger

func (*CommonProcessor) ProcessContent

func (processor *CommonProcessor) ProcessContent(content Content, rMsg ReliableMessage) []Content

type FacebookDatabase

type FacebookDatabase struct {
	IFacebookDatabase
	// contains filtered or unexported fields
}

func (*FacebookDatabase) AddContact

func (db *FacebookDatabase) AddContact(contact ID, user ID) bool

func (*FacebookDatabase) AddMember

func (db *FacebookDatabase) AddMember(member ID, group ID) bool

func (*FacebookDatabase) AddUser

func (db *FacebookDatabase) AddUser(user ID) bool

func (*FacebookDatabase) AllUsers

func (db *FacebookDatabase) AllUsers() []ID

func (*FacebookDatabase) GetAssistants

func (db *FacebookDatabase) GetAssistants(group ID) []ID

func (*FacebookDatabase) GetContacts

func (db *FacebookDatabase) GetContacts(user ID) []ID

func (*FacebookDatabase) GetCurrentUser

func (db *FacebookDatabase) GetCurrentUser() ID

func (*FacebookDatabase) GetDocument

func (db *FacebookDatabase) GetDocument(entity ID, docType string) Document

func (*FacebookDatabase) GetFounder

func (db *FacebookDatabase) GetFounder(group ID) ID

func (*FacebookDatabase) GetMembers

func (db *FacebookDatabase) GetMembers(group ID) []ID

func (*FacebookDatabase) GetMeta

func (db *FacebookDatabase) GetMeta(entity ID) Meta

func (*FacebookDatabase) GetOwner

func (db *FacebookDatabase) GetOwner(group ID) ID

func (*FacebookDatabase) GetPrivateKeyForSignature

func (db *FacebookDatabase) GetPrivateKeyForSignature(user ID) PrivateKey

func (*FacebookDatabase) GetPrivateKeyForVisaSignature

func (db *FacebookDatabase) GetPrivateKeyForVisaSignature(user ID) PrivateKey

func (*FacebookDatabase) GetPrivateKeysForDecryption

func (db *FacebookDatabase) GetPrivateKeysForDecryption(user ID) []DecryptKey

func (*FacebookDatabase) Init

func (db *FacebookDatabase) Init() *FacebookDatabase

func (*FacebookDatabase) RemoveContact

func (db *FacebookDatabase) RemoveContact(contact ID, user ID) bool

func (*FacebookDatabase) RemoveGroup

func (db *FacebookDatabase) RemoveGroup(group ID) bool

func (*FacebookDatabase) RemoveMember

func (db *FacebookDatabase) RemoveMember(member ID, group ID) bool

func (*FacebookDatabase) RemoveUser

func (db *FacebookDatabase) RemoveUser(user ID) bool

func (*FacebookDatabase) SaveContacts

func (db *FacebookDatabase) SaveContacts(contacts []ID, user ID) bool

func (*FacebookDatabase) SaveDocument

func (db *FacebookDatabase) SaveDocument(doc Document) bool

func (*FacebookDatabase) SaveMembers

func (db *FacebookDatabase) SaveMembers(members []ID, group ID) bool

func (*FacebookDatabase) SaveMeta

func (db *FacebookDatabase) SaveMeta(meta Meta, entity ID) bool

func (*FacebookDatabase) SavePrivateKey

func (db *FacebookDatabase) SavePrivateKey(user ID, key PrivateKey, keyType string, sign bool, decrypt bool) bool

func (*FacebookDatabase) SetContactTable

func (db *FacebookDatabase) SetContactTable(table ContactTable)

func (*FacebookDatabase) SetCurrentUser

func (db *FacebookDatabase) SetCurrentUser(user ID)

func (*FacebookDatabase) SetDocumentTable

func (db *FacebookDatabase) SetDocumentTable(table DocumentTable)

func (*FacebookDatabase) SetGroupTable

func (db *FacebookDatabase) SetGroupTable(table GroupTable)

func (*FacebookDatabase) SetMetaTable

func (db *FacebookDatabase) SetMetaTable(table MetaTable)

func (*FacebookDatabase) SetPrivateKeyTable

func (db *FacebookDatabase) SetPrivateKeyTable(table PrivateKeyTable)

func (*FacebookDatabase) SetUserTable

func (db *FacebookDatabase) SetUserTable(table UserTable)

type ICommonFacebook

type ICommonFacebook interface {
	IFacebook
	IFacebookExtension

	DB() IFacebookDatabase
	SetDB(db IFacebookDatabase)
}

type ICommonMessenger

type ICommonMessenger interface {
	IMessenger
	IMessengerExtension
}

type IFacebookDatabase

type IFacebookDatabase interface {
	PrivateKeyTable
	MetaTable
	DocumentTable

	UserTable
	GroupTable
	ContactTable
}

type IFacebookExtension

type IFacebookExtension interface {
	SavePrivateKey(key PrivateKey, keyType string, user ID) bool

	SetCurrentUser(user User)
	AddUser(user User) bool
	RemoveUser(user User) bool

	AddContact(contact ID, user ID) bool
	RemoveContact(contact ID, user ID) bool

	AddMember(member ID, group ID) bool
	RemoveMember(member ID, group ID) bool
	ContainMember(member ID, group ID) bool
	ContainAssistant(bot ID, group ID) bool
	RemoveGroup(group ID) bool

	GetName(entity ID) string

	IsExpiredDocument(doc Document, reset bool) bool
}

type IMessengerExtension

type IMessengerExtension interface {

	/**
	 *  Query meta from network with ID
	 */
	QueryMeta(identifier ID) bool

	/**
	 *  Query document from network with ID & type
	 */
	QueryDocument(identifier ID, docType string) bool

	/**
	 *  Query group info from members
	 */
	QueryGroupInfo(group ID, members []ID) bool
}

type KeyCache

type KeyCache struct {
	CipherKeyDelegate
	// contains filtered or unexported fields
}

func (*KeyCache) CacheCipherKey

func (cache *KeyCache) CacheCipherKey(sender, receiver ID, key SymmetricKey)

func (*KeyCache) GetCipherKey

func (cache *KeyCache) GetCipherKey(sender, receiver ID, generate bool) SymmetricKey

func (*KeyCache) Init

func (cache *KeyCache) Init() *KeyCache

func (*KeyCache) SetKeyTable

func (cache *KeyCache) SetKeyTable(table MsgKeyTable)

Directories

Path Synopsis
license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.
license: https://mit-license.org * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 Albert Moky * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software.

Jump to

Keyboard shortcuts

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