service

package
v0.0.0-...-3f8ce9d Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBPathCfgName = "salty"
	// DBPathIDsDir contains all the user accounts
	DBPathIDsDir = "identities"
	// DBPathCurrIDDir contains the current account in the ui
	DBPathCurrIDDir = "identity"
	// DBPathContactsDir contains account directory to which it belongs to and
	// then all the contacts inside that directory
	DBPathContactsDir = "contacts"
	// DBPathMessagesDir contains account directory which in turn
	// contains contact directory to which it belongs to and
	// then all the messages inside that directory
	DBPathMessagesDir = "messages"
)
View Source
const AppIndexedDBVersion int64 = 1
View Source
const AppLookupEndPoint = BaseURL + "/api/v1/lookup"
View Source
const AppRegisterEndPoint = "https://salty.mills.io"
View Source
const AppSendEndPoint = BaseURL + "/api/v1/send"
View Source
const BaseURL = "https://salty.mills.io"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigJSON

type ConfigJSON struct {
	Config saltyim.Config
	Hash   string
	User   string
	Domain string
}

type Message

type Message struct {
	UserAddr    string
	ContactAddr string
	From        string
	To          string
	Created     string
	Text        string
	Key         string
}

Message properties UserAddr and ContactAddr keyConfigMessages

type Service

type Service interface {
	Loaded() bool
	IsCurrIDAddr(addrStr string) bool
	Identity() *saltyim.Identity
	Register(addrStr string) <-chan error
	CreateIDFromAddrStr(addrStr string) <-chan error
	SendMessage(addrStr string, msg string) <-chan error
	NewChat(addrStr string) <-chan error
	GetContactAddr(addrStr string) *saltyim.Addr
	ContactsAddresses() []*saltyim.Addr
	Identities() []*saltyim.Identity
	ConfigJSON() (*ConfigJSON, error)
	Messages(contactAddr string) []Message
	CreateIDFromBytes(bs []byte) <-chan error
}

func NewService

func NewService() Service

NewService Always call this function to create Service

Jump to

Keyboard shortcuts

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