mau

package module
v0.0.0-...-15cd245 Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: AGPL-3.0 Imports: 30 Imported by: 2

README

Mau Go

The Mau network concept implementation in Go.

NOTE

This project is a work in progress and alot of stuff will change and break. it can be split or merged to other projects.

Usage

The repository is a go module. you can use go mod download to add it to your project

Troubleshooting

Linux UDP Pool Fix

On linux we need to run this command to increase UDP packet size pool

sysctl -w net.core.rmem_max=2500000

ref: https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPassphraseConfirmation = errors.New("Passphrase confirmation is not identical")
	ErrPassphraseRequired     = errors.New("Passphrase must be specified")
	ErrIncorrectPassphrase    = errors.New("Incorrect passphrase")
	ErrAccountLocked          = errors.New("Account is locked")
	ErrNoIdentity             = errors.New("Can't find identity")
)
View Source
var (
	AccountsRoot = path.Join(userConfigDir, "mau")
)

Functions

func Follow

func Follow(account *Account, friend *Friend) error

func RemoveFile

func RemoveFile(account *Account, file *File) error

func RemoveFriend

func RemoveFriend(account *Account, friend *Friend) error

func Unfollow

func Unfollow(account *Account, friend *Friend) error

Types

type Account

type Account struct {
	Path string
	// contains filtered or unexported fields
}

func ListAccounts

func ListAccounts() ([]*Account, error)

func NewAccount

func NewAccount(name, email, passphrase, confirmPassphrase string) (*Account, error)

func (*Account) Email

func (a *Account) Email() (string, error)

func (*Account) Export

func (a *Account) Export() ([]byte, error)

func (*Account) Fingerprint

func (a *Account) Fingerprint() (string, error)

func (*Account) Identity

func (a *Account) Identity() (string, error)

func (*Account) Lock

func (a *Account) Lock()

func (*Account) Locked

func (a *Account) Locked() bool

func (*Account) Name

func (a *Account) Name() (string, error)

func (*Account) String

func (a *Account) String() string

func (*Account) Unlock

func (a *Account) Unlock(passphrase string) error

type File

type File struct {
	Path string
	// contains filtered or unexported fields
}

func AddFile

func AddFile(account *Account, r io.Reader, name string, recipients []*Friend) (*File, error)

func GetFile

func GetFile(account *Account, fpr, name string) (*File, error)

func GetVersion

func GetVersion(account *Account, fpr, name, version string) (*File, error)

func ListFiles

func ListFiles(account *Account, fingerprint string, after time.Time, limit int) []*File

func (*File) Hash

func (f *File) Hash() (string, error)

func (*File) Name

func (f *File) Name() string

func (*File) Reader

func (f *File) Reader(account *Account) (io.Reader, error)

func (*File) Recipients

func (f *File) Recipients(account *Account) ([]*Friend, error)

func (*File) Size

func (f *File) Size() (int64, error)

func (*File) Versions

func (f *File) Versions() []*File

type Friend

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

func AddFriend

func AddFriend(account *Account, reader io.Reader) (*Friend, error)

func ListFollows

func ListFollows(account *Account) ([]*Friend, error)

func (*Friend) Email

func (f *Friend) Email() (string, error)

func (*Friend) Fingerprint

func (f *Friend) Fingerprint() string

func (*Friend) Identity

func (f *Friend) Identity() (string, error)

func (*Friend) Name

func (f *Friend) Name() (string, error)

type KeyRing

type KeyRing struct {
	Path     string
	Friends  []*Friend
	KeyRings []*KeyRing
}

func ListFriends

func ListFriends(account *Account) (*KeyRing, error)

func (*KeyRing) FindByFingerprint

func (k *KeyRing) FindByFingerprint(fingerprint string) *Friend

func (*KeyRing) FriendById

func (k *KeyRing) FriendById(id uint64) *Friend

func (*KeyRing) FriendsSet

func (k *KeyRing) FriendsSet() []*Friend

func (*KeyRing) Name

func (k *KeyRing) Name() string

type Peer

type Peer struct {
	Account *Account
	// contains filtered or unexported fields
}

func NewPeer

func NewPeer(account *Account) (*Peer, error)

func (*Peer) Addresses

func (p *Peer) Addresses() ([]string, error)

func (*Peer) HandlePeerFound

func (p *Peer) HandlePeerFound(pi peer.AddrInfo)

func (*Peer) Serve

func (p *Peer) Serve() error

type Server

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

func NewServer

func NewServer(account *Account, port string) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

Jump to

Keyboard shortcuts

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