Documentation
¶
Index ¶
- Constants
- func ImageToString(img *image) string
- func NewImage(val, t string) *image
- func RandomGroupImage(handle string) string
- func RandomProfileImage(onion string) string
- func StringToImage(str string) (*image, error)
- type Contact
- type EventHandler
- func (eh *EventHandler) AddModule(ehi EventHandlerInterface)
- func (eh *EventHandler) GetNextEvent() string
- func (eh *EventHandler) GetProfileImage(profile peer.CwtchPeer, conversationInfo *model.Conversation, basepath string) string
- func (eh *EventHandler) HandleApp(application app.Application)
- func (eh *EventHandler) Push(newEvent event.Event)
- type EventHandlerInterface
- type EventProfileEnvelope
Constants ¶
View Source
const ( // TypeImageDistro is a reletive path to any of the distributed images in cwtch/ui in the assets folder TypeImageDistro = "distro" // TypeImageComposition will be an face image composed of a recipe of parts like faceType, eyeType, etc TypeImageComposition = "composition" )
Image types we support
View Source
const ( Warn = event.Field("Warn") Error = event.Field("Error") Debug = event.Field("Debug") Info = event.Field("Info") )
Logging Levels as Event Fields. Note: Unlike most event we don't cae about the *value* of the field, only the presence. If more than one of these fields is present in a single SetLoggingLevel event then the highest logging level is used. INFO < WARN < ERROR < DEBUG
View Source
const ReloadEvent = event.Field("Reload")
View Source
const (
SetLoggingLevel = event.Type("SetLoggingLevel")
)
An event to set the logging level dynamically from the UI
Variables ¶
This section is empty.
Functions ¶
func ImageToString ¶
func ImageToString(img *image) string
func RandomGroupImage ¶
func RandomProfileImage ¶
temporary until we do real picture selection
func StringToImage ¶
Types ¶
type Contact ¶
type Contact struct {
Name string `json:"name"`
LocalName string `json:"localname"`
Onion string `json:"onion"`
Status string `json:"status"`
Picture string `json:"picture"`
DefaultPicture string `json:"defaultPicture"`
Accepted bool `json:"accepted"`
AccessControlList model.AccessControlList `json:"accessControlList"`
Blocked bool `json:"blocked"`
SaveHistory string `json:"saveConversationHistory"`
Messages int `json:"numMessages"`
Unread int `json:"numUnread"`
LastSeenMessageId int `json:"lastSeenMessageId"`
LastMessage string `json:"lastMsgTime"`
IsGroup bool `json:"isGroup"`
GroupServer string `json:"groupServer"`
IsArchived bool `json:"isArchived"`
Identifier int `json:"identifier"`
NotificationPolicy string `json:"notificationPolicy"`
IsManaged bool `json:"managed"`
Attributes map[string]string `json:"attributes"`
GroupMode model.GroupMode `json:"mode"`
GroupMask model.GroupMode `json:"modeMask"`
}
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func NewEventHandler ¶
func NewEventHandler() *EventHandler
func (*EventHandler) AddModule ¶
func (eh *EventHandler) AddModule(ehi EventHandlerInterface)
func (*EventHandler) GetNextEvent ¶
func (eh *EventHandler) GetNextEvent() string
func (*EventHandler) GetProfileImage ¶
func (eh *EventHandler) GetProfileImage(profile peer.CwtchPeer, conversationInfo *model.Conversation, basepath string) string
func (*EventHandler) HandleApp ¶
func (eh *EventHandler) HandleApp(application app.Application)
func (*EventHandler) Push ¶
func (eh *EventHandler) Push(newEvent event.Event)
Push pushes an event onto the app event bus
It is also a way for libCwtch-go to publish an event for consumption by a UI before a Cwtch app has been initialized use: to signal an error before a cwtch app could be created
type EventHandlerInterface ¶
type EventHandlerInterface interface {
OnACNStatusEvent(appl app.Application, e *event.Event)
}
type EventProfileEnvelope ¶
Click to show internal directories.
Click to hide internal directories.