daemon

package
v0.0.0-...-72cce0b Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// LastCommit is the first 7 letters of the last commit, injected at build time
	LastCommit = "unknown"
	// BuildVer is the Go Version used to build this program, obviously injected at build time
	BuildVer = "unknown"
)
View Source
var (
	NewMessageHook func(uuid.UUID, ...types.Message)
	NewRoomHook    func(info *types.RoomInfo)
	ErrorHook      func(error)
	NewRequestHook func(*types.RoomRequest)
)
View Source
var (
	TorInfo = getTorInfo

	ListContactIDs  = listContactIDs
	CreateContactID = createContactID
	DeleteContact   = DeleteContactID

	RoomInfo      = roomInfo
	Rooms         = listRooms
	CreateRoom    = createRoom
	DeleteRoom    = deleteRoom
	AddPeerToRoom = addPeerToRoom
	ListMessages  = listMessages

	SendMessage = sendMessage

	RequestList       = requestList
	AcceptRoomRequest = acceptRoomRequest
	DeleteRoomRequest = deleteRoomRequest
)

Functions

func DeleteContactID

func DeleteContactID(fingerprint string) error

DeleteContactID deletes and deregisters a contact id.

func GetContactID

func GetContactID(fingerprint string) (types.Identity, bool)

func GetRoom

func GetRoom(id uuid.UUID) (*types.Room, bool)

func StartDaemon

func StartDaemon(conf Config)

StartDaemon is used to start the application for creating identities and rooms. Also sending/receiving messages etc. Basically everything except the frontend API.

Types

type Config

type Config struct {
	BaseDir, TorBinary                      string
	PortOffset                              int
	UseControlPass, AutoAccept, Interactive bool
}

type SerializableData

type SerializableData struct {
	ContactIdentities []types.Identity     `json:"contactIdentities"`
	Rooms             []*types.Room        `json:"rooms"`
	Requests          []*types.RoomRequest `json:"requests"`
}

SerializableData struct exists purely for serialization purposes

type StringWriter

type StringWriter struct {
	OnWrite func(string)
}

func (StringWriter) Write

func (w StringWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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