groups

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package groups implements a group-model of communication on top of the AirDispatch protocol. It is implemented in the Melange source code to show that it is truly the client's interpretation of how Group-based messaging should exist, independent of how AirDispatch sees the world.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

func CreateGroup

func CreateGroup(

	name string,

	owner *identity.Identity,

	server *identity.Address,

	r routing.Router,
	memberString ...string,
) (*Group, error)

CreateGroup will create a new Melange group on a server.

It performs the following sequence of actions: 1. Generate a new identity. 2. Register the identity with a server. 3. Choose a random symmetric key to use for group messages. 4. Send invitations to each original member:

  • Signed by the group creator
  • Signed by the group identity
  • Containing the group identity
  • Containing the symmetric key

func CreateGroupFromInvitation

func CreateGroupFromInvitation(invite *message.Mail, router routing.Router) (*Group, error)

CreateGroupFromInvitation will create a Group object for use.

func RequestJoinGroup

func RequestJoinGroup(address string) (*Group, error)

func (*Group) Delete

func (g *Group) Delete() error

Delete will deregister a group (identity) from a server thus deleting all of its messages.

func (*Group) GetMessages

func (g *Group) GetMessages(since uint64) ([]*message.Mail, error)

GetMessages will download all messages from a group in order to display them to the user. Remember that all group communication is considered "public" so we will utilize the RetrievePublicMail method.

func (*Group) Invite

func (g *Group) Invite(user string, rekey bool) error

Invite will invite a member to the Group g.

func (*Group) Kick

func (g *Group) Kick(user string) error

Kick will remove the `user` from the Group g.

func (*Group) Leave

func (g *Group) Leave(user *identity.Identity, alert bool) error

Leave will remove the `user` from the Group g.

func (*Group) PostMessage

func (g *Group) PostMessage(msg *message.Mail, sender *identity.Identity) (string, error)

PostMessage will post an AirDispatch message to a specific Melange group. Specifically, it will do the following.

1. Sign the message with the keys of the group and the author. 2. Encrypt the message with the current group identity / key. 3. Publish the message as "public" from the group identity.

func (*Group) RemoveMessage

func (g *Group) RemoveMessage(name string) error

RemoveMessageFromGroup will remove an AirDispatch message from a group.

Jump to

Keyboard shortcuts

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