handlers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeMessage

func ComposeMessage(addressing message.Addressing, subject string, b, a []string) error

ComposeMessage composes a new message from the given account Info to the "to" with given subject, blocks and attachments

func CreateAccount

func CreateAccount(v *vault.Vault, addrStr, name, tokenStr string, kt bmcrypto.KeyType)

CreateAccount creates a new account locally in the vault, stores it on the mail server and pushes the public key to the resolver

func CreateAuthorizedKey

func CreateAuthorizedKey(info *vault.AccountInfo, targetKey *bmcrypto.PubKey, validUntil time.Duration, desc string) (string, error)

CreateAuthorizedKey creates a new authorized key

func CreateOrganisation

func CreateOrganisation(v *vault.Vault, orgAddr, fullName string, orgValidations []string, kt bmcrypto.KeyType)

CreateOrganisation creates a new organisation locally in the vault and pushes the public key to the resolver

func CreateOrganisationInvite

func CreateOrganisationInvite(vault *vault.Vault, orgAddr, inviteAddr, shortRoutingID string)

CreateOrganisationInvite invites a user to an organisation on the given routing-id

func ListAccounts

func ListAccounts(v *vault.Vault, displayKeys bool)

ListAccounts displays the current accounts available in the vault

func ListMessages

func ListMessages(accounts []vault.AccountInfo, since time.Time) int

ListMessages will display message information from accounts and boxes

func ListOrganisations

func ListOrganisations(v *vault.Vault, displayKeys bool)

ListOrganisations displays the current accounts available in the vault

func OtpGenerate

func OtpGenerate(info *vault.AccountInfo, otpServer *string)

OtpGenerate will generate an OTP valid for otpServer

func ReadMessages

func ReadMessages(info *vault.AccountInfo, routingInfo *resolver.RoutingInfo, box, messageID string, since time.Time)

ReadMessages will read a specific message blocks

Types

type AccountData

type AccountData []AccountEntry

AccountData is the complete list of all messages we want to display.

func (AccountData) Len

func (ad AccountData) Len() int

Len returns the length of the account data

func (AccountData) Less

func (ad AccountData) Less(i, j int) bool

Less will sort account entries on account first, box second, idx third.

func (AccountData) Swap

func (ad AccountData) Swap(i, j int)

Swap will swap two account data entries in the slice

type AccountEntry

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

AccountEntry is a single entry to display

Jump to

Keyboard shortcuts

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